Add launcher prefetch setting
Summary: Allows users to override the GK status of prefetching. It is implemented as a Tri-State. "Unset" means that the local Flipper config won't take precedent over the GK setting and will leave it unchanged. If a user interacts with the setting, it gets persisted into the config and will from then-on override the GK, meaning that the user has an opt-in mechanism and if we open the GK to more people, they effectively have an opt-out. Reviewed By: jknoxville Differential Revision: D18008259 fbshipit-source-id: bdfde9a8b9acf43aa60c84800a7979a29a4e9364
This commit is contained in:
committed by
Facebook Github Bot
parent
836a065e59
commit
82a253cf28
@@ -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<Props, State> {
|
||||
frozen
|
||||
/>
|
||||
</ToggledSection>
|
||||
<LauncherSettingsPanel
|
||||
enabledInConfig={this.state.updatedSettings.enablePrefetching}
|
||||
onChange={v => {
|
||||
this.setState({
|
||||
updatedSettings: {
|
||||
...this.state.updatedSettings,
|
||||
enablePrefetching: v,
|
||||
},
|
||||
});
|
||||
}}
|
||||
/>
|
||||
<br />
|
||||
<FlexRow>
|
||||
<Spacer />
|
||||
|
||||
Reference in New Issue
Block a user