mirror of
https://github.com/felixrieseberg/windows95.git
synced 2026-05-09 00:24:09 +00:00
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:
@@ -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",
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user