From 5f4611d65e40eae3ca6191a15f68d69ea5a1c4cb Mon Sep 17 00:00:00 2001 From: Kirill Rogovoy Date: Tue, 20 Jul 2021 21:24:52 +0300 Subject: WIP --- web-build/expo-service-worker.js | 1 - 1 file changed, 1 deletion(-) delete mode 100644 web-build/expo-service-worker.js (limited to 'web-build/expo-service-worker.js') diff --git a/web-build/expo-service-worker.js b/web-build/expo-service-worker.js deleted file mode 100644 index 50b4b60..0000000 --- a/web-build/expo-service-worker.js +++ /dev/null @@ -1 +0,0 @@ -self.addEventListener("message",t=>{let i;if("string"===typeof t.data)try{i=JSON.parse(t.data)}catch(e){}i&&i.fromExpoWebClient&&(self.notificationIcon=i.fromExpoWebClient.notificationIcon)}),self.addEventListener("push",t=>{let i={};try{i=t.data.json()}catch(a){i={title:"",body:t.data.text()}}const e=i.title,n=i.data||i.custom||{},o={body:i.body,data:n};o.icon=n._icon||i.icon||self.notificationIcon||null,o.image=n._richContent&&n._richContent.image?o.data._richContent.image:i.image,o.tag=n._tag||i.collapseKey,o.tag&&(o.renotify=n._renotify),t.waitUntil(self.registration.showNotification(e,o))}),self.addEventListener("notificationclick",t=>{t.notification.close(),t.waitUntil((async()=>{const i=await self.clients.matchAll({includeUncontrolled:!0});let e;const n=t.notification.data._webPath||"/";for(const t of i){if(new URL(t.url).pathname===n){t.focus(),e=t;break}}e||(e=await self.clients.openWindow(n)),e.postMessage({origin:"selected",data:t.notification.data,remote:!t.notification._isLocal})})())}),self.importScripts("service-worker.js"); \ No newline at end of file -- cgit v1.2.3