forked from trent_larson/crowd-funder-for-time-pwa
remove IndexedDB keys that shouldn't be keys, and remove unused table, and add commentary
This commit is contained in:
@@ -414,11 +414,11 @@ async function appendDailyLog(message) {
|
||||
const db = await openIndexedDB("TimeSafari");
|
||||
const transaction = db.transaction("logs", "readwrite");
|
||||
const store = transaction.objectStore("logs");
|
||||
// will only keep one day's worth of logs
|
||||
// only keep one day's worth of logs
|
||||
const todayKey = new Date().toDateString();
|
||||
const previous = await getRecord(store, todayKey);
|
||||
if (!previous) {
|
||||
await store.clear(); // clear out anything older than today
|
||||
await store.clear(); // clear out everything previous when this is today's first log
|
||||
}
|
||||
let fullMessage = (previous && previous.message) || "";
|
||||
if (fullMessage) {
|
||||
@@ -468,9 +468,6 @@ async function fetchAllAccounts() {
|
||||
if (!db.objectStoreNames.contains("accounts")) {
|
||||
db.createObjectStore("accounts", { keyPath: "id" });
|
||||
}
|
||||
if (!db.objectStoreNames.contains("worker_log")) {
|
||||
db.createObjectStore("worker_log");
|
||||
}
|
||||
};
|
||||
|
||||
openRequest.onsuccess = function (event) {
|
||||
|
||||
Reference in New Issue
Block a user