Skip to content

Commit

Permalink
fix: Possible issue when subscribing user to notifications on login (c…
Browse files Browse the repository at this point in the history
…loses #460)
  • Loading branch information
claustres committed Nov 15, 2024
1 parent d108cbb commit 840b709
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/boot/kdk.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,10 +101,10 @@ export default async ({ app }) => {
beforeGuard.registerGuard(permissionsGuard)

// updateThemeColors()

api.on('authenticated', (data) => {
// Subscribe to webpush notifications
utils.subscribeToPushNotifications()
// User will be updated in store just after login so that we need to wait for the event
Events.once('user-changed', utils.subscribeToPushNotifications)
// Store API gateway token if any
if (data.gatewayToken) api.get('storage').setItem(config.gatewayJwt, data.gatewayToken)
})
Expand Down

0 comments on commit 840b709

Please sign in to comment.