From f2a7ea3af919548d41383734e8a3667086a44bcc Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Wed, 31 May 2023 06:10:51 +0300 Subject: eslint: enforce semicolons only before statement continuation chars --- src/main/resources/static/sw.js | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) (limited to 'src/main/resources/static') diff --git a/src/main/resources/static/sw.js b/src/main/resources/static/sw.js index 0520bcc1..a64de7cc 100644 --- a/src/main/resources/static/sw.js +++ b/src/main/resources/static/sw.js @@ -2,46 +2,46 @@ /// /// -var sw = /** @type {ServiceWorkerGlobalScope & typeof self} */ (self); +var sw = /** @type {ServiceWorkerGlobalScope & typeof self} */ (self) sw.addEventListener('install', function() { - sw.skipWaiting(); -}); + sw.skipWaiting() +}) sw.addEventListener('activate', function() { - sw.clients.claim(); -}); + sw.clients.claim() +}) sw.addEventListener('push', function(evt) { if (evt.data) { - const data = evt.data.json(); - console.log('Push', data); + const data = evt.data.json() + console.log('Push', data) if (data.body) { sw.registration.showNotification(data.title, { body: data.body, icon: data.custom.message.user.avatar, tag: data.tag, data: data.custom.message - }); + }) } } -}); +}) sw.addEventListener('notificationclick', function(evt) { evt.waitUntil( sw.clients.matchAll().then(function(clientList) { - const message = evt.notification.data; + const message = evt.notification.data const url = message.mid ? message.rid ? `https://juick.com/m/${message.mid}#${message.rid}` : `https://juick.com/m/${message.mid}` - : 'https://juick.com/pm/inbox'; + : 'https://juick.com/pm/inbox' if (clientList.length > 0) { for (var i = 0; i < clientList.length; i++) { if (clientList[i].url === url) { - return clientList[i].focus(); + return clientList[i].focus() } } - clientList[0].navigate(url); - return clientList[0].focus(); + clientList[0].navigate(url) + return clientList[0].focus() } - return sw.clients.openWindow(url); + return sw.clients.openWindow(url) }) - ); -}); + ) +}) -- cgit v1.2.3