From f257584e9c42eda5b16d4e7cff2def401797fbd1 Mon Sep 17 00:00:00 2001 From: Kelvin Schoofs Date: Thu, 17 Dec 2020 14:02:12 +0100 Subject: [PATCH] Add "" dropdown to host field in UI --- webview/src/ConfigEditor/fields.tsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/webview/src/ConfigEditor/fields.tsx b/webview/src/ConfigEditor/fields.tsx index f0587a1..f1758c1 100644 --- a/webview/src/ConfigEditor/fields.tsx +++ b/webview/src/ConfigEditor/fields.tsx @@ -54,9 +54,11 @@ export function putty(config: FileSystemConfig, onChange: FSCChanged<'putty'>): } export function host(config: FileSystemConfig, onChange: FSCChanged<'host'>): React.ReactElement { - const callback = (value?: string) => onChange('host', value); + const callback = (newValue?: string) => onChange('host', newValue === '' ? (true as any) : newValue); const description = 'Hostname or IP address of the server. Supports environment variables, e.g. $HOST'; - return + const values = ['']; + const value = (config.host as any) === true ? '' : config.host; + return } export function port(config: FileSystemConfig, onChange: FSCChanged<'port'>): React.ReactElement {