diff --git a/src/chrome/SettingsSheet.tsx b/src/chrome/SettingsSheet.tsx index a6b048d7a..4903c3f9a 100644 --- a/src/chrome/SettingsSheet.tsx +++ b/src/chrome/SettingsSheet.tsx @@ -18,6 +18,7 @@ import ToggledSection from './settings/ToggledSection'; import {FilePathConfigField, ConfigText} from './settings/configFields'; import isEqual from 'lodash.isequal'; import restartFlipper from '../utils/restartFlipper'; +import LauncherSettingsPanel from '../fb-stubs/LauncherSettingsPanel'; const Container = styled(FlexColumn)({ padding: 20, @@ -102,6 +103,17 @@ class SettingsSheet extends Component { frozen /> + { + this.setState({ + updatedSettings: { + ...this.state.updatedSettings, + enablePrefetching: v, + }, + }); + }} + />
diff --git a/src/fb-stubs/LauncherSettingsPanel.tsx b/src/fb-stubs/LauncherSettingsPanel.tsx new file mode 100644 index 000000000..06fce1136 --- /dev/null +++ b/src/fb-stubs/LauncherSettingsPanel.tsx @@ -0,0 +1,17 @@ +/** + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @format + */ + +import {Tristate} from 'src/reducers/settings'; + +export default function(_props: { + enabledInConfig: Tristate; + onChange: (v: Tristate) => void; +}) { + return null; +} diff --git a/src/fb-stubs/Prefetcher.tsx b/src/fb-stubs/Prefetcher.tsx index 8cb8a7580..34b6d0f44 100644 --- a/src/fb-stubs/Prefetcher.tsx +++ b/src/fb-stubs/Prefetcher.tsx @@ -8,3 +8,4 @@ */ export default async function setupPrefetcher() {} +export const shouldInstallPrefetcher = () => false; diff --git a/src/reducers/settings.tsx b/src/reducers/settings.tsx index 5b4678eed..2b1517e40 100644 --- a/src/reducers/settings.tsx +++ b/src/reducers/settings.tsx @@ -9,9 +9,21 @@ import {Actions} from './index'; +export enum Tristate { + True, + False, + Unset, +} + export type Settings = { androidHome: string; enableAndroid: boolean; + /** + * If unset, this will assume the value of the GK setting. + * Note that this setting has no effect in the open source version + * of Flipper. + */ + enablePrefetching: Tristate; }; export type Action = @@ -24,6 +36,7 @@ export type Action = const initialState: Settings = { androidHome: '/opt/android_sdk', enableAndroid: true, + enablePrefetching: Tristate.Unset, }; export default function reducer(