Send notification on appointment update

This commit is contained in:
snegov committed 2024-08-01 14:06:01 -07:00
1 parent c31ab1eb64
commit 8697c717b8
1 file changed
+6 -2
+6 -2
View File
@@ -501,8 +501,12 @@ async function runner() {
}
if (apptDate != ctx.currentAppt.date || apptConsulate != ctx.currentAppt.consulate) {
console.log(`New appointment date: ${apptDate} at ${apptConsulate},
old: ${ctx.currentAppt.consulate} at ${ctx.currentAppt.date}`);
msg = `New appointment date: ${apptDate} at ${apptConsulate}`
if (ctx.currentAppt.date != null) {
sendNotification(msg);
}
msg += `, was: ${ctx.currentAppt.consulate} at ${ctx.currentAppt.date}`
console.log(msg);
ctx.currentAppt = { consulate: apptConsulate, date: apptDate };
await chrome.storage.local.set({ "ctx_currentAppt": ctx.currentAppt });
}