Make "Start without state" always enabled (#360)

The menu item now works whether the machine is running or not. bootFromScratch() awaits stopEmulator() first (a no-op when already stopped), so invoking it mid-session saves the current state, tears down the running VM, and boots a fresh one.
This commit is contained in:
Felix Rieseberg
2026-04-11 18:39:45 -07:00
committed by GitHub
parent 766497bd5d
commit 5da7f94c5a
2 changed files with 2 additions and 2 deletions

View File

@@ -137,7 +137,6 @@ async function createMenu({ isRunning } = { isRunning: false }) {
{
label: "Start without state",
click: () => send(IPC_COMMANDS.MACHINE_BOOT_FROM_SCRATCH),
enabled: !isRunning,
},
{
label: "Restart",

View File

@@ -314,7 +314,8 @@ export class Emulator extends React.Component<{}, EmulatorState> {
/**
* Boot the emulator without restoring state
*/
public bootFromScratch() {
public async bootFromScratch() {
await this.stopEmulator();
this.setState({ isBootingFresh: true });
this.startEmulator();
}