feat: enhance sync functionality with unsynced answer detection and UI updates

This commit is contained in:
Ross
2026-06-29 11:49:45 +01:00
parent 499707f946
commit 253b0bc183
2 changed files with 22 additions and 3 deletions
+2 -1
View File
@@ -4,7 +4,7 @@ import * as viewer from "./viewer.js";
import * as interact from "./interact.js";
import * as config from "./config.js";
import { db, question_db } from "./db.js";
import { initSync, triggerImmediateSync } from "./sync.js";
import { initSync, triggerImmediateSync, updateSyncUI } from "./sync.js";
// const { v4: uuidv4 } = require('uuid');
log.setDefaultLevel("warn")
@@ -207,6 +207,7 @@ cornerstoneTools.init();
function putAnswer(answer) {
answer.time_answered = new Date().toISOString();
answer.synced = false;
updateSyncUI("syncing");
db.answers.put(answer).then(() => {
triggerImmediateSync(exam_details, URLS);
});