log service worker messages to the DB (now works)

This commit is contained in:
2023-12-22 12:51:18 -07:00
parent e739d0be7c
commit 7fe256dc9e
6 changed files with 50 additions and 41 deletions

View File

@@ -373,6 +373,7 @@ export default class App extends Vue {
}
private askPermission(): Promise<NotificationPermission> {
console.log("Requesting permission for notifications:", navigator);
if (!("serviceWorker" in navigator && navigator.serviceWorker.controller)) {
return Promise.reject("Service worker not available.");
}

View File

@@ -3,5 +3,8 @@ export interface Log {
}
export const LogSchema = {
logs: "message",
// Currently keyed by "date" because A) today's log data is what we need so we append, and
// B) we don't want it to grow so we remove everything if this is the first entry today.
// See safari-notifications.js logMessage for the associated logic.
logs: "date, message",
};