add minute to notification scheduling & fix a bug, plus other tweaks

This commit is contained in:
2024-11-15 20:39:08 -07:00
parent f06eb27ba0
commit 2c0c7ac256
6 changed files with 106 additions and 22 deletions

View File

@@ -305,8 +305,8 @@ export default class HelpNotificationsView extends Vue {
async mounted() {
try {
const registration = await navigator.serviceWorker.ready;
const fullSub = await registration.pushManager.getSubscription();
const registration = await navigator.serviceWorker?.ready;
const fullSub = await registration?.pushManager.getSubscription();
this.subscriptionJSON = fullSub?.toJSON();
} catch (error) {
console.error("Mount error:", error);
@@ -366,7 +366,7 @@ export default class HelpNotificationsView extends Vue {
showTestNotification() {
const TEST_NOTIFICATION_TITLE = "It Worked";
navigator.serviceWorker.ready
navigator.serviceWorker?.ready
.then((registration) => {
return registration.showNotification(TEST_NOTIFICATION_TITLE, {
body: "This is your test notification.",