Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F85651295
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
View Options
diff --git a/src/sw.js b/src/sw.js
index 5577291a30..a80b49044c 100644
--- a/src/sw.js
+++ b/src/sw.js
@@ -1,42 +1,40 @@
/* eslint-env serviceworker */
import localForage from 'localforage'
function isEnabled () {
return localForage.getItem('vuex-lz')
.then(data => data.config.webPushNotifications)
}
function getWindowClients () {
return clients.matchAll({ includeUncontrolled: true })
.then((clientList) => clientList.filter(({ type }) => type === 'window'))
}
self.addEventListener('push', (event) => {
if (event.data) {
event.waitUntil(isEnabled().then((isEnabled) => {
return isEnabled && getWindowClients().then((list) => {
const data = event.data.json()
if (list.length === 0) return self.registration.showNotification(data.title, data)
})
}))
}
})
self.addEventListener('notificationclick', (event) => {
event.notification.close()
event.waitUntil(getWindowClients().then((list) => {
for (var i = 0; i < list.length; i++) {
var client = list[i]
if (client.url === '/' && 'focus' in client) { return client.focus() }
}
if (clients.openWindow) return clients.openWindow('/')
}))
})
-self.addEventListener('fetch', (event) => {
- return
-})
+self.addEventListener('fetch', _ => _)
File Metadata
Details
Attached
Mime Type
text/x-diff
Expires
Sun, Aug 30, 4:46 PM (1 d, 15 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1738077
Default Alt Text
(1 KB)
Attached To
Mode
rPUFE pleroma-fe-upstream
Attached
Detach File
Event Timeline
Log In to Comment