Fix issue #202 (Settings UI writing true instead of "pageant" to the "agent" field)

pull/208/head
Kelvin Schoofs 4 years ago
parent 76fad83d0c
commit 26abb22372

@ -72,11 +72,10 @@ export function root(config: FileSystemConfig, onChange: FSCChanged<'root'>): Re
}
export function agent(config: FileSystemConfig, onChange: FSCChanged<'agent'>): React.ReactElement {
const callback = (newValue: string) => onChange('agent', newValue === 'pageant' ? (true as any) : newValue);
const callback = (newValue: string) => onChange('agent', newValue);
const description = `Path to ssh-agent's UNIX socket for ssh-agent-based user authentication. Supports 'pageant' for PuTTY's Pagent, and environment variables, e.g. $SSH_AUTH_SOCK`;
const values = ['pageant', '//./pipe/openssh-ssh-agent', '$SSH_AUTH_SOCK'];
const value = (config.agent as any) === true ? 'pageant' : config.agent;
return <FieldDropdownWithInput key="agent" label="Agent" {...{ value, values, description }} onChange={callback} optional={true} />
return <FieldDropdownWithInput key="agent" label="Agent" {...{ value: config.agent, values, description }} onChange={callback} optional={true} />
}
export function username(config: FileSystemConfig, onChange: FSCChanged<'username'>): React.ReactElement {

Loading…
Cancel
Save