From 4b83bcb5caa2bafb528502ea68821355e5893e08 Mon Sep 17 00:00:00 2001 From: Pranav Raj S Date: Sun, 26 Mar 2023 12:19:29 -0700 Subject: [PATCH] fix: Move subscription to after initialize (#6752) --- app/javascript/dashboard/App.vue | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/app/javascript/dashboard/App.vue b/app/javascript/dashboard/App.vue index 0d0a6906c..ccae9e52c 100644 --- a/app/javascript/dashboard/App.vue +++ b/app/javascript/dashboard/App.vue @@ -72,13 +72,6 @@ export default { if (!this.hasAccounts) { this.showAddAccountModal = true; } - verifyServiceWorkerExistence(registration => - registration.pushManager.getSubscription().then(subscription => { - if (subscription) { - registerSubscription(); - } - }) - ); }, currentAccountId() { if (this.currentAccountId) { @@ -107,6 +100,14 @@ export default { this.updateRTLDirectionView(locale); this.latestChatwootVersion = latestChatwootVersion; vueActionCable.init(pubsubToken); + + verifyServiceWorkerExistence(registration => + registration.pushManager.getSubscription().then(subscription => { + if (subscription) { + registerSubscription(); + } + }) + ); }, }, };