Fix: Todo Multi refresh ...
fix some promises problem
This commit is contained in:
@@ -59,7 +59,8 @@ export default class Home extends Vue {
|
||||
window.addEventListener('beforeinstallprompt', function (event) {
|
||||
// console.log('******************************** beforeinstallprompt fired')
|
||||
event.preventDefault()
|
||||
console.log('§§§§§§§§§§§§§§§§§§§§ IMPOSTA DEFERRED PROMPT !!!!!!!!!!!!!!!!! ')
|
||||
// console.log('§§§§§§§§§§§§§§§§§§§§ IMPOSTA DEFERRED PROMPT !!!!!!!!!!!!!!!!! ')
|
||||
// #Todo++ IMPOSTA DEFERRED PROMPT
|
||||
return false
|
||||
})
|
||||
|
||||
@@ -69,6 +70,10 @@ export default class Home extends Vue {
|
||||
return Notification.permission
|
||||
}
|
||||
|
||||
NotServiceWorker () {
|
||||
return (!('serviceWorker' in navigator))
|
||||
}
|
||||
|
||||
displayConfirmNotification() {
|
||||
let options = null
|
||||
if ('serviceWorker' in navigator) {
|
||||
@@ -88,10 +93,12 @@ export default class Home extends Vue {
|
||||
]
|
||||
}
|
||||
|
||||
navigator.serviceWorker.ready
|
||||
.then(function (swreg) {
|
||||
swreg.showNotification('Successfully subscribed!', options)
|
||||
})
|
||||
if ('serviceWorker' in navigator) {
|
||||
navigator.serviceWorker.ready
|
||||
.then(function (swreg) {
|
||||
swreg.showNotification('Successfully subscribed!', options)
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -168,7 +175,6 @@ export default class Home extends Vue {
|
||||
}
|
||||
|
||||
|
||||
|
||||
test_fetch() {
|
||||
fetch('https:/httpbin.org/post', {
|
||||
method: 'POST',
|
||||
|
||||
@@ -5,6 +5,8 @@
|
||||
<q-btn v-if="getPermission() !== 'granted'" class="enable-notifications" color="primary" rounded size="lg" icon="notifications" @click="askfornotification" :label="$t('notification.ask')"/>
|
||||
<q-btn v-if="getPermission() === 'granted'" class="enable-notifications" color="primary" rounded size="lg" icon="notifications" @click="showNotificationExample" label="Send Notification"/>
|
||||
<!--<q-btn v-if="getPermission() === 'granted'" class="enable-notifications" color="secondary" rounded size="lg" icon="notifications" @click="createPushSubscription" label="Create Push Subscription !"/>-->
|
||||
|
||||
|
||||
<br>
|
||||
<div>
|
||||
<q-chip square color="secondary">
|
||||
@@ -16,6 +18,12 @@
|
||||
:label="$t('notification.titlegranted')"
|
||||
helper="Stato Notifiche">
|
||||
</q-field>
|
||||
<q-field
|
||||
v-if="NotServiceWorker()"
|
||||
icon="notifications"
|
||||
label="Service Worker not present"
|
||||
>
|
||||
</q-field>
|
||||
</div>
|
||||
|
||||
</q-page>
|
||||
|
||||
Reference in New Issue
Block a user