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:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user