diff --git a/src/locales/en.json b/src/locales/en.json index cb8a1ae9..c3d98f7e 100644 --- a/src/locales/en.json +++ b/src/locales/en.json @@ -473,6 +473,7 @@ "blocked": "Notification is blocked, the reminder notification will not work! Please enable it on your browser.", "desktop": "Desktop browser cannot receive notification if the browser is not running!", "early": "The notification may arrive earlier (about 1-10 minutes) because of the way we send the notification", + "allowNotification": "Please allow the notification prompt that shows up!", "transformer": "Parametric Transformer Reminder", "last": "Enter when you last used the Parametric Transformer", "countdown": "Enter countdown time of the Parametric Transformer (If you don't remember the exact time, you need to approximate it)", diff --git a/src/routes/reminder.svelte b/src/routes/reminder.svelte index 2a3fe406..e04be710 100644 --- a/src/routes/reminder.svelte +++ b/src/routes/reminder.svelte @@ -17,9 +17,9 @@ import { pushToast } from '../stores/toast'; import { + loading, firebaseToken, firstLoadNotification, - loading, loadingFirst, notificationAllowed, notificationSupported, @@ -198,6 +198,9 @@ {#if loadingSave}{/if} {$t('reminder.set')} + {#if $loading} +

{$t('reminder.allowNotification')}

+ {/if}
diff --git a/src/stores/firebase.js b/src/stores/firebase.js index f0a169e7..e1f23b7b 100644 --- a/src/stores/firebase.js +++ b/src/stores/firebase.js @@ -15,7 +15,6 @@ const firebaseConfig = { appId: __paimon.env.FIREBASE_APP_ID, }; -let firebase; let messaging; export async function firstLoadNotification() { @@ -65,9 +64,6 @@ async function initFirebase() { console.log('init firebase'); if (!messaging) { - firebase = (await import('firebase/app')).default; - await import('firebase/messaging'); - firebase.initializeApp(firebaseConfig); messaging = firebase.messaging(); } diff --git a/src/template.html b/src/template.html index 412b18c0..00f9764d 100644 --- a/src/template.html +++ b/src/template.html @@ -21,6 +21,9 @@ + + +