forked from trent_larson/crowd-funder-for-time-pwa
add minute to notification scheduling & fix a bug, plus other tweaks
This commit is contained in:
@@ -595,6 +595,7 @@
|
||||
|
||||
<div id="sectionPartnerServerURL" class="mt-2">
|
||||
<span class="text-slate-500 text-sm font-bold">Partner Server URL</span>
|
||||
|
||||
<span class="text-sm">{{ DEFAULT_PARTNER_API_SERVER }}</span>
|
||||
</div>
|
||||
|
||||
@@ -830,7 +831,7 @@ export default class AccountViewView extends Vue {
|
||||
/**
|
||||
* Beware! I've seen where this "ready" never resolves.
|
||||
*/
|
||||
const registration = await navigator.serviceWorker.ready;
|
||||
const registration = await navigator.serviceWorker?.ready;
|
||||
this.subscription = await registration.pushManager.getSubscription();
|
||||
this.isSubscribed = !!this.subscription;
|
||||
// console.log("Got to the end of 'mounted' call in AccountViewView.");
|
||||
|
||||
@@ -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