fix: Move subscription to after initialize (#6752)

This commit is contained in:
Pranav Raj S
2023-03-26 12:19:29 -07:00
committed by GitHub
parent 70e7530cb4
commit 4b83bcb5ca

View File

@@ -72,13 +72,6 @@ export default {
if (!this.hasAccounts) { if (!this.hasAccounts) {
this.showAddAccountModal = true; this.showAddAccountModal = true;
} }
verifyServiceWorkerExistence(registration =>
registration.pushManager.getSubscription().then(subscription => {
if (subscription) {
registerSubscription();
}
})
);
}, },
currentAccountId() { currentAccountId() {
if (this.currentAccountId) { if (this.currentAccountId) {
@@ -107,6 +100,14 @@ export default {
this.updateRTLDirectionView(locale); this.updateRTLDirectionView(locale);
this.latestChatwootVersion = latestChatwootVersion; this.latestChatwootVersion = latestChatwootVersion;
vueActionCable.init(pubsubToken); vueActionCable.init(pubsubToken);
verifyServiceWorkerExistence(registration =>
registration.pushManager.getSubscription().then(subscription => {
if (subscription) {
registerSubscription();
}
})
);
}, },
}, },
}; };