From 45e508fc36681bf5b9438074c8c7914f1a6568d2 Mon Sep 17 00:00:00 2001 From: Andrew Bastin Date: Wed, 3 Nov 2021 23:44:01 +0530 Subject: [PATCH] refactor: pwa install prompt (#1932) --- packages/hoppscotch-app/components/app/Header.vue | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/packages/hoppscotch-app/components/app/Header.vue b/packages/hoppscotch-app/components/app/Header.vue index d8556738f..6ae5faccc 100644 --- a/packages/hoppscotch-app/components/app/Header.vue +++ b/packages/hoppscotch-app/components/app/Header.vue @@ -128,7 +128,7 @@ const t = i18n.t.bind(i18n) * that can be called to show the user the installation * prompt. */ -const showInstallPrompt = ref(null) +const showInstallPrompt = ref(() => Promise.resolve()) // Async no-op till it is initialized const showSupport = ref(false) const showSearch = ref(false) @@ -156,9 +156,7 @@ onMounted(async () => { // Initializes the PWA code - checks if the app is installed, // etc. - // TODO: @liyasthomas, check this out (initializePwa is a () => Promise) - await intializePwa() - showInstallPrompt.value = undefined + showInstallPrompt.value = intializePwa() const cookiesAllowed = getLocalConfig("cookiesAllowed") === "yes" if (!cookiesAllowed) {