Update Flipper version on restart from settings

Summary: Delegate to launcher on restart after settings changed. This is required to update Flipper after changing release channel.

Reviewed By: passy

Differential Revision: D25331466

fbshipit-source-id: d98e272971b5782d3b9c46e6ba62d883ebbb804c
This commit is contained in:
Anton Nikolaev
2020-12-04 08:09:50 -08:00
committed by Facebook GitHub Bot
parent 534d407a7c
commit 139c6674f3
2 changed files with 12 additions and 3 deletions

View File

@@ -80,7 +80,7 @@ class SettingsSheet extends Component<Props, State> {
this.props.updateLauncherSettings(this.state.updatedLauncherSettings);
this.props.onHide();
flush().then(() => {
restartFlipper();
restartFlipper(true);
});
};

View File

@@ -10,9 +10,18 @@
import {remote} from 'electron';
import isProduction from './isProduction';
export default function restart() {
export default function restart(update: boolean = false) {
if (isProduction()) {
remote.app.relaunch();
if (update) {
const options = {
args: process.argv
.splice(0, 1)
.filter((arg) => arg !== '--no-launcher' && arg !== '--no-updater'),
};
remote.app.relaunch(options);
} else {
remote.app.relaunch();
}
remote.app.exit();
} else {
// Relaunching the process with the standard way doesn't work in dev mode.