From a89761c3dc6b211262660e0cce9c833d016a3919 Mon Sep 17 00:00:00 2001 From: Xeovalyte Date: Mon, 15 May 2023 15:06:45 +0200 Subject: [PATCH] Added messages --- frontend/app.vue | 63 +++++++++++++++++---------- frontend/components/Login.vue | 2 + frontend/composables/notifications.js | 2 - 3 files changed, 41 insertions(+), 26 deletions(-) diff --git a/frontend/app.vue b/frontend/app.vue index 919fc2d..fb600cc 100644 --- a/frontend/app.vue +++ b/frontend/app.vue @@ -1,21 +1,37 @@ @@ -23,22 +39,21 @@ import { Device } from '@capacitor/device'; const userStore = useUserStore() +const showInstallGuide = ref(true) onMounted(async () => { userStore.init() Device.getInfo().then(info => { - if (info.platform === 'ios') document.getElementsByClassName('top-right')[0].classList.add('toastios') - }); + if (info.platform === 'ios') { + showInstallGuide.value = false; + document.getElementsByClassName('top-right')[0].classList.add('toastios') + } else if (info.platform === 'web' && process.client && 'serviceWorker' in navigator && window.isSecureContext) { + if (window.matchMedia('(display-mode: standalone)').matches) showInstallGuide.value = false - if (process.client) { - if ('serviceWorker' in navigator && window.isSecureContext) { - Device.getInfo().then(info => { - if (info.platform === 'web') registerServiceWorker() - else document.getElementsByClassName('top-right')[0].classList.add('toastios') - }); + registerServiceWorker() } - } + }); }) diff --git a/frontend/components/Login.vue b/frontend/components/Login.vue index 26326e6..21dcec1 100644 --- a/frontend/components/Login.vue +++ b/frontend/components/Login.vue @@ -17,6 +17,8 @@ + + Is dit jouw eerste keer inloggen? Gebruik dan als email het email dat gebruikt is bij de inschrijving en het wachtwoord is uw Lidnummmer / Sportlinknummer

Account aanmaken voor
{{ form.email }}

diff --git a/frontend/composables/notifications.js b/frontend/composables/notifications.js index 924bca1..3a6816e 100644 --- a/frontend/composables/notifications.js +++ b/frontend/composables/notifications.js @@ -101,8 +101,6 @@ export const setupWebNotifications = () => { export const setupNotifications = async () => { const info = await Device.getInfo(); - console.log(info); - if (info.platform !== 'web') setupIosNotifications() else setupWebNotifications() }