From 44f32494b8bc8f384a9915e8f2172b8c858b097d Mon Sep 17 00:00:00 2001 From: summersamara Date: Tue, 4 Apr 2023 17:50:27 +0200 Subject: [PATCH] call refreshApp() and reload the page on refreshApp event without displaying popup message --- js/src/App.vue | 39 ++++++++++++++------------------------- 1 file changed, 14 insertions(+), 25 deletions(-) diff --git a/js/src/App.vue b/js/src/App.vue index 309331248..3053af85a 100644 --- a/js/src/App.vue +++ b/js/src/App.vue @@ -129,31 +129,20 @@ export default class App extends Vue { console.debug("online"); }); document.addEventListener("refreshApp", (event: Event) => { - this.$buefy.snackbar.open({ - queue: false, - indefinite: true, - type: "is-secondary", - actionText: this.$t("Update app") as string, - cancelText: this.$t("Ignore") as string, - message: this.$t("A new version is available.") as string, - onAction: async () => { - // eslint-disable-next-line @typescript-eslint/ban-ts-comment - // @ts-ignore - const detail = event.detail; - const registration = detail as ServiceWorkerRegistration; - try { - await this.refreshApp(registration); - window.location.reload(); - } catch (err) { - console.error(err); - this.$notifier.error( - this.$t( - "An error has occured while refreshing the page." - ) as string - ); - } - }, - }); + const refreshAppEvent = async () => { + // eslint-disable-next-line @typescript-eslint/ban-ts-comment + // @ts-ignore + const detail = event.detail; + const registration = detail as ServiceWorkerRegistration; + try { + await this.refreshApp(registration); + window.location.reload(); + } catch (err) { + console.error(err); + } + }; + + refreshAppEvent(); }); this.interval = setInterval(async () => {