aboutsummaryrefslogtreecommitdiff
path: root/Timeline/ClientApp/src/sw/sw.ts
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2020-06-11 23:15:10 +0800
committercrupest <crupest@outlook.com>2020-06-11 23:15:10 +0800
commit64c4376ed388af106c1de5ec8bd1d1743950a27e (patch)
treec1b4d3f4b83f5114febecb6f2e2cc6e982ec97f2 /Timeline/ClientApp/src/sw/sw.ts
parent93ce8560fa19c3a91de99643fdbbe4f895a47b84 (diff)
downloadtimeline-64c4376ed388af106c1de5ec8bd1d1743950a27e.tar.gz
timeline-64c4376ed388af106c1de5ec8bd1d1743950a27e.tar.bz2
timeline-64c4376ed388af106c1de5ec8bd1d1743950a27e.zip
feat(front): Application upgrade ui.
Diffstat (limited to 'Timeline/ClientApp/src/sw/sw.ts')
-rw-r--r--Timeline/ClientApp/src/sw/sw.ts6
1 files changed, 6 insertions, 0 deletions
diff --git a/Timeline/ClientApp/src/sw/sw.ts b/Timeline/ClientApp/src/sw/sw.ts
index 67f5dfd4..e7558015 100644
--- a/Timeline/ClientApp/src/sw/sw.ts
+++ b/Timeline/ClientApp/src/sw/sw.ts
@@ -4,6 +4,12 @@ import { NetworkOnly } from 'workbox-strategies';
declare let self: ServiceWorkerGlobalScope;
+self.addEventListener('message', (event) => {
+ if (event.data && (event.data as { type: string }).type === 'SKIP_WAITING') {
+ void self.skipWaiting();
+ }
+});
+
precacheAndRoute(self.__WB_MANIFEST);
const networkOnly = new NetworkOnly();