diff --git a/desktop/app/src/chrome/SettingsSheet.tsx b/desktop/app/src/chrome/SettingsSheet.tsx index 514fa2b0e..e58471af7 100644 --- a/desktop/app/src/chrome/SettingsSheet.tsx +++ b/desktop/app/src/chrome/SettingsSheet.tsx @@ -86,6 +86,7 @@ class SettingsSheet extends Component { androidHome, enableIOS, enablePrefetching, + idbPath, reactNative, } = this.state.updatedSettings; @@ -104,7 +105,7 @@ class SettingsSheet extends Component { }); }}> { @@ -137,6 +138,16 @@ class SettingsSheet extends Component { content={'iOS development is only supported on MacOS'} /> )} + { + this.setState({ + updatedSettings: {...this.state.updatedSettings, idbPath: v}, + }); + }} + /> void; frozen?: boolean; + // Defaults to allowing directories only, this changes to expect regular files. + isRegularFile?: boolean; }) { const [value, setValue] = useState(props.defaultValue); const [isValid, setIsValid] = useState(true); fs.stat(value) - .then((stat) => stat.isDirectory()) + .then((stat) => props.isRegularFile !== stat.isDirectory()) .then((valid) => { if (valid !== isValid) { setIsValid(valid); diff --git a/desktop/app/src/reducers/settings.tsx b/desktop/app/src/reducers/settings.tsx index 88e4906b2..8966193ee 100644 --- a/desktop/app/src/reducers/settings.tsx +++ b/desktop/app/src/reducers/settings.tsx @@ -27,6 +27,7 @@ export type Settings = { * of Flipper. */ enablePrefetching: Tristate; + idbPath: string; jsApps: { webAppLauncher: { url: string; @@ -57,6 +58,7 @@ const initialState: Settings = { enableAndroid: true, enableIOS: os.platform() === 'darwin', enablePrefetching: Tristate.Unset, + idbPath: '/usr/local/bin/idb', jsApps: { webAppLauncher: { url: 'http://localhost:8888',