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
commit532775219a11817cea0f5c44c9bbcc99d815a884 (patch)
tree7025158d81076aabd42bd864217bf3c07cca2128 /Timeline/ClientApp/src/sw/sw.ts
parentcf6cfe87b46a2a3eb2913209092ab4c5639e75c3 (diff)
downloadtimeline-532775219a11817cea0f5c44c9bbcc99d815a884.tar.gz
timeline-532775219a11817cea0f5c44c9bbcc99d815a884.tar.bz2
timeline-532775219a11817cea0f5c44c9bbcc99d815a884.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();