|
@ -389,8 +389,8 @@ async function setMostRecentNotified(id) { |
|
|
const db = await openIndexedDB("TimeSafari"); |
|
|
const db = await openIndexedDB("TimeSafari"); |
|
|
const transaction = db.transaction("settings", "readwrite"); |
|
|
const transaction = db.transaction("settings", "readwrite"); |
|
|
const store = transaction.objectStore("settings"); |
|
|
const store = transaction.objectStore("settings"); |
|
|
|
|
|
|
|
|
const data = await getRecord(store, 1); |
|
|
const data = await getRecord(store, 1); |
|
|
|
|
|
|
|
|
if (data) { |
|
|
if (data) { |
|
|
data["lastNotifiedClaimId"] = id; |
|
|
data["lastNotifiedClaimId"] = id; |
|
|
await updateRecord(store, data); |
|
|
await updateRecord(store, data); |
|
@ -409,12 +409,6 @@ function openIndexedDB(dbName) { |
|
|
const request = indexedDB.open(dbName); |
|
|
const request = indexedDB.open(dbName); |
|
|
request.onerror = () => reject(request.error); |
|
|
request.onerror = () => reject(request.error); |
|
|
request.onsuccess = () => resolve(request.result); |
|
|
request.onsuccess = () => resolve(request.result); |
|
|
request.onupgradeneeded = (event) => { |
|
|
|
|
|
const db = event.target.result; |
|
|
|
|
|
if (!db.objectStoreNames.contains("settings")) { |
|
|
|
|
|
db.createObjectStore("settings"); |
|
|
|
|
|
} |
|
|
|
|
|
}; |
|
|
|
|
|
}); |
|
|
}); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -526,10 +520,10 @@ async function getNotificationCount() { |
|
|
} |
|
|
} |
|
|
const most_recent_notified = claims[0]["id"]; |
|
|
const most_recent_notified = claims[0]["id"]; |
|
|
await setMostRecentNotified(most_recent_notified); |
|
|
await setMostRecentNotified(most_recent_notified); |
|
|
return "TEST"; |
|
|
|
|
|
} else { |
|
|
} else { |
|
|
console.error(response.status); |
|
|
console.error(response.status); |
|
|
} |
|
|
} |
|
|
|
|
|
break; |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|