From 5da7f94c5ac9bbde25f923ec294a55b767f7cf50 Mon Sep 17 00:00:00 2001 From: Felix Rieseberg Date: Sat, 11 Apr 2026 18:39:45 -0700 Subject: [PATCH] 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. --- src/main/menu.ts | 1 - src/renderer/emulator.tsx | 3 ++- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/menu.ts b/src/main/menu.ts index 4330c58..25fb93c 100644 --- a/src/main/menu.ts +++ b/src/main/menu.ts @@ -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", diff --git a/src/renderer/emulator.tsx b/src/renderer/emulator.tsx index d9f40cf..25d7d87 100644 --- a/src/renderer/emulator.tsx +++ b/src/renderer/emulator.tsx @@ -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(); }