From e351d3cb2f8183bb4335b3b21e154f46d9237a76 Mon Sep 17 00:00:00 2001 From: Thomas Citharel Date: Fri, 11 Aug 2023 12:22:02 +0200 Subject: [PATCH] fix: fix some typescript issues with pwa Signed-off-by: Thomas Citharel --- js/src/App.vue | 4 +++- js/tsconfig.json | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/js/src/App.vue b/js/src/App.vue index 108981bb..0ab57378 100644 --- a/js/src/App.vue +++ b/js/src/App.vue @@ -178,7 +178,9 @@ onMounted(() => { cancelText: t("Ignore"), message: t("A new version is available."), onAction: async () => { - const registration = event.detail as ServiceWorkerRegistration; + const registration = ( + event as unknown as { detail: ServiceWorkerRegistration } + ).detail; try { await refreshApp(registration); window.location.reload(); diff --git a/js/tsconfig.json b/js/tsconfig.json index a8f27a55..a8bb8cbe 100644 --- a/js/tsconfig.json +++ b/js/tsconfig.json @@ -14,7 +14,7 @@ "isolatedModules": true, "sourceMap": true, "baseUrl": ".", - "types": ["webpack-env", "jest", "vite/client"], + "types": ["webpack-env", "jest", "vite/client", "vite-plugin-pwa/vue"], "typeRoots": ["./@types", "./node_modules/@types"], "paths": { "@/*": ["src/*"]