Skip to content

Commit

Permalink
feat: added broadcast for email confirmation
Browse files Browse the repository at this point in the history
  • Loading branch information
mwargan committed Apr 23, 2024
1 parent 2672f93 commit 78e683e
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/eventBus/listeners/broadcastChannel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@ bc.onmessage = (event) => {
router.go(0);
}

if (event.data.type === eventTypes.confirmed_email) {
// refresh the page
router.go(0);
}

if (event.data.type === eventTypes.changed_locale) {
setI18nLanguage(i18n, event.data.data, false);
}
Expand Down Expand Up @@ -56,4 +61,10 @@ export default {
data: e,
});
},
confirmed_email: (e: any) => {
bc.postMessage({
type: eventTypes.confirmed_email,
data: e,
});
},
} as Record<eventTypes, any>;

0 comments on commit 78e683e

Please sign in to comment.