Fix breakage after recent FW (Date object serializes differently)

pull/3516/head
Travis Evans 2024-05-10 20:26:13 -05:00
parent 3073404766
commit 1dd88b29b2
1 changed files with 9 additions and 1 deletions

View File

@ -129,7 +129,15 @@ class StampLog {
} }
if (this.isDirty) { if (this.isDirty) {
if (storage.writeJSON(this.filename, this.log)) { let logToSave = [];
for (let logEntry of this.log) {
// Serialize each Date object into an ISO string before saving
let newEntry = Object.assign({}, logEntry);
newEntry.stamp = logEntry.stamp.toISOString();
logToSave.push(newEntry);
}
if (storage.writeJSON(this.filename, logToSave)) {
console.log('stamplog: save to storage completed'); console.log('stamplog: save to storage completed');
this.isDirty = false; this.isDirty = false;
} else { } else {