(notification) add vibration

This commit is contained in:
2020-07-02 08:53:31 +02:00
parent f0a9fdd38a
commit 155f67c7e5
2 changed files with 5 additions and 6 deletions

View File

@@ -1,6 +1,6 @@
<template> <template>
<div class="dream-maker"> <div class="dream-maker">
<h2>Coder {{ position }}</h2> <h2>code {{ position }}</h2>
<h4 v-show="isTurn">{{ session }}</h4> <h4 v-show="isTurn">{{ session }}</h4>
</div> </div>
</template> </template>

View File

@@ -5,11 +5,10 @@ import { register } from 'register-service-worker'
if (process.env.NODE_ENV === 'production') { if (process.env.NODE_ENV === 'production') {
register(`${process.env.BASE_URL}service-worker.js`, { register(`${process.env.BASE_URL}service-worker.js`, {
ready(sw) { ready(sw) {
console.log( console.log('App is being served from cache by a service worker')
'App is being served from cache by a service worker.\n' + sw.showNotification('Session started!', {
'For more details, visit https://goo.gl/AFskqB' vibrate: [300, 100, 400]
) })
sw.showNotification('Coucou')
}, },
registered() { registered() {
console.log('Service worker has been registered.') console.log('Service worker has been registered.')