fix: Load default stopwatch data if file is missing

Co-authored-by: aider (gemini/gemini-2.5-pro) <aider@aider.chat>
This commit is contained in:
2026-03-09 14:12:12 -06:00
parent 0b4d8d84c4
commit d2d89b361e

View File

@@ -11,7 +11,7 @@
let watchState = STATE_IDLE;
let stopWatch = require("Storage").readJSON("mystopwatch.json", {start1: null, elapsed1: null, start2: null, elapsed2: null});
let stopWatch = require("Storage").readJSON("mystopwatch.json", true) || {start1: null, elapsed1: null, start2: null, elapsed2: null};
let saveStopWatch = function() {
require("Storage").writeJSON("mystopwatch.json", stopWatch);
}