diff --git a/src/ui/views/TimerView.tsx b/src/ui/views/TimerView.tsx index 1d07f92de..5d34d1821 100644 --- a/src/ui/views/TimerView.tsx +++ b/src/ui/views/TimerView.tsx @@ -180,7 +180,7 @@ function View({ diff --git a/src/util/LSOCommandSink.ts b/src/util/LSOCommandSink.ts index 7857c030a..359c27e7b 100644 --- a/src/util/LSOCommandSink.ts +++ b/src/util/LSOCommandSink.ts @@ -111,13 +111,12 @@ export class LSOCommandSink { return result; } - public async reset(): Promise { + public async reset(updateSplits?: boolean): Promise { if (this.locked) { return CommandError.Busy; } - let updateSplits = true; - if (this.timer.currentAttemptHasNewBestTimes()) { + if (updateSplits === undefined && this.timer.currentAttemptHasNewBestTimes()) { const [result] = await showDialog({ title: "Save Best Times?", description: @@ -130,7 +129,7 @@ export class LSOCommandSink { updateSplits = result === 0; } - const result = this.timer.reset(updateSplits) as CommandResult; + const result = this.timer.reset(updateSplits ?? true) as CommandResult; if (isEvent(result)) { this.callbacks.handleEvent(result);