diff --git a/package.json b/package.json index 78e6b2bb8..edabef149 100644 --- a/package.json +++ b/package.json @@ -76,7 +76,6 @@ "@types/react-redux": "^7.1.5", "@types/react-virtualized-auto-sizer": "^1.0.0", "@types/react-window": "^1.8.1", - "@types/redux-persist": "^4.3.1", "@types/rsocket-core": "^0.0.3", "@types/testing-library__react": "^9.1.2", "@types/tmp": "^0.1.0", @@ -110,6 +109,7 @@ "dependencies": { "@emotion/core": "^10.0.22", "@emotion/styled": "^10.0.23", + "@iarna/toml": "^2.2.3", "@types/promise-retry": "^1.1.3", "@types/react-color": "^3.0.1", "@types/react-test-renderer": "^16.9.1", diff --git a/src/chrome/SettingsSheet.tsx b/src/chrome/SettingsSheet.tsx index 4903c3f9a..b8130aef7 100644 --- a/src/chrome/SettingsSheet.tsx +++ b/src/chrome/SettingsSheet.tsx @@ -10,6 +10,11 @@ import {FlexColumn, Button, styled, Text, FlexRow, Spacer} from 'flipper'; import React, {Component} from 'react'; import {updateSettings, Action} from '../reducers/settings'; +import { + Action as LauncherAction, + LauncherSettings, + updateLauncherSettings, +} from '../reducers/launcherSettings'; import {connect} from 'react-redux'; import {State as Store} from '../reducers'; import {Settings} from '../reducers/settings'; @@ -38,25 +43,30 @@ type OwnProps = { type StateFromProps = { settings: Settings; + launcherSettings: LauncherSettings; isXcodeDetected: boolean; }; type DispatchFromProps = { updateSettings: (settings: Settings) => Action; + updateLauncherSettings: (settings: LauncherSettings) => LauncherAction; }; type State = { updatedSettings: Settings; + updatedLauncherSettings: LauncherSettings; }; type Props = OwnProps & StateFromProps & DispatchFromProps; class SettingsSheet extends Component { state: State = { updatedSettings: {...this.props.settings}, + updatedLauncherSettings: {...this.props.launcherSettings}, }; applyChanges = async () => { this.props.updateSettings(this.state.updatedSettings); + this.props.updateLauncherSettings(this.state.updatedLauncherSettings); this.props.onHide(); flush().then(() => { restartFlipper(); @@ -104,8 +114,8 @@ class SettingsSheet extends Component { /> { + isPrefetchingEnabled={this.state.updatedSettings.enablePrefetching} + onEnablePrefetchingChange={v => { this.setState({ updatedSettings: { ...this.state.updatedSettings, @@ -113,6 +123,15 @@ class SettingsSheet extends Component { }, }); }} + isLocalPinIgnored={this.state.updatedLauncherSettings.ignoreLocalPin} + onIgnoreLocalPinChange={v => { + this.setState({ + updatedLauncherSettings: { + ...this.state.updatedLauncherSettings, + ignoreLocalPin: v, + }, + }); + }} />
@@ -121,7 +140,13 @@ class SettingsSheet extends Component { Cancel