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) {
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();
}
})
);
},
},
};