Add restartFlipper utility
Summary: Centralizes the restart logic. And adds ability for it to work in dev mode as well. Reviewed By: passy Differential Revision: D18008197 fbshipit-source-id: b76ac7935d5859dfdbb8cf593462f8ac02348181
This commit is contained in:
committed by
Facebook Github Bot
parent
9775e5b0e0
commit
c63f145ffb
@@ -35,6 +35,7 @@ import {promisify} from 'util';
|
||||
import {homedir} from 'os';
|
||||
import {PluginManager as PM} from 'live-plugin-manager';
|
||||
import {reportPlatformFailures, reportUsage} from '../utils/metrics';
|
||||
import restartFlipper from '../utils/restartFlipper';
|
||||
|
||||
const PLUGIN_DIR = path.join(homedir(), '.flipper', 'thirdparty');
|
||||
const ALGOLIA_APPLICATION_ID = 'OFCNCOG2CU';
|
||||
@@ -121,8 +122,7 @@ const PluginInstaller = function props(props: Props) {
|
||||
props.getInstalledPlugins,
|
||||
);
|
||||
const restartApp = useCallback(() => {
|
||||
remote.app.relaunch();
|
||||
remote.app.exit();
|
||||
restartFlipper();
|
||||
}, []);
|
||||
|
||||
return (
|
||||
|
||||
@@ -16,8 +16,8 @@ import {Settings} from '../reducers/settings';
|
||||
import {flush} from '../utils/persistor';
|
||||
import ToggledSection from './settings/ToggledSection';
|
||||
import {FilePathConfigField, ConfigText} from './settings/configFields';
|
||||
import {remote} from 'electron';
|
||||
import isEqual from 'lodash.isequal';
|
||||
import restartFlipper from '../utils/restartFlipper';
|
||||
|
||||
const Container = styled(FlexColumn)({
|
||||
padding: 20,
|
||||
@@ -58,8 +58,7 @@ class SettingsSheet extends Component<Props, State> {
|
||||
this.props.updateSettings(this.state.updatedSettings);
|
||||
this.props.onHide();
|
||||
flush().then(() => {
|
||||
remote.app.relaunch();
|
||||
remote.app.exit();
|
||||
restartFlipper();
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user