diff --git a/packages/app-desktop/gui/ConfigScreen/ConfigScreen.tsx b/packages/app-desktop/gui/ConfigScreen/ConfigScreen.tsx index 20a74e19e6..0dfede1a99 100644 --- a/packages/app-desktop/gui/ConfigScreen/ConfigScreen.tsx +++ b/packages/app-desktop/gui/ConfigScreen/ConfigScreen.tsx @@ -484,13 +484,19 @@ class ConfigScreenComponent extends React.Component { } else { const paths = await bridge().showOpenDialog(); if (!paths || !paths.length) return; - const cmd = splitCmd(this.state.settings[key]); - cmd[0] = paths[0]; - updateSettingValue(key, joinCmd(cmd)); + + if (md.subType === 'file_path') { + updateSettingValue(key, paths[0]); + } else { + const cmd = splitCmd(this.state.settings[key]); + cmd[0] = paths[0]; + updateSettingValue(key, joinCmd(cmd)); + } } }; const cmd = splitCmd(this.state.settings[key]); + const path = md.subType === 'file_path_and_args' ? cmd[0] : this.state.settings[key]; const argComp = md.subType !== 'file_path_and_args' ? null : (
@@ -526,7 +532,7 @@ class ConfigScreenComponent extends React.Component { onChange={(event: any) => { onPathChange(event); }} - value={cmd[0]} + value={path} spellCheck={false} />