forked from jsnbuchanan/crowd-funder-for-time-pwa
add minute to notification scheduling & fix a bug, plus other tweaks
This commit is contained in:
@@ -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.",
|
||||
|
||||
Reference in New Issue
Block a user