Skip to content

Commit

Permalink
fix: async
Browse files Browse the repository at this point in the history
  • Loading branch information
IsaccoSordo committed Jun 17, 2024
1 parent 6e491c6 commit 3099420
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/beacon-core/src/utils/multi-tab-channel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,9 @@ export class MultiTabChannel {
this.channel.removeEventListener('message', this.eventListeners[1])
}

private onMessageHandler(message: Message) {
private async onMessageHandler(message: Message) {
if (message.type === 'LEADER_DEAD') {
this.elector.awaitLeadership().then(() => logger.log('The tab is now the leader'))
await this.elector.awaitLeadership()

if (this.isLeader()) {
this.onElectedLeaderHandler()
Expand Down

0 comments on commit 3099420

Please sign in to comment.