Skip to content

Commit

Permalink
fix: awaited destroy
Browse files Browse the repository at this point in the history
  • Loading branch information
isordo committed Oct 27, 2023
1 parent 028c604 commit 55c5bea
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/beacon-dapp/src/dapp-client/DAppClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -464,7 +464,7 @@ export class DAppClient extends Client {
await this.events.emit(BeaconEvent.CHANNEL_CLOSED)
this.setActiveAccount(undefined)

this.destroy()
await this.destroy()
}

async destroy(): Promise<void> {
Expand Down Expand Up @@ -636,8 +636,8 @@ export class DAppClient extends Client {
public async setActiveAccount(account?: AccountInfo): Promise<void> {
if (account && this._activeAccount.isSettled() && (await this.isInvalidState(account))) {
setTimeout(() => this.events.emit(BeaconEvent.HIDE_UI))
this.destroy()
this.setActiveAccount(undefined)
await this.destroy()
await this.setActiveAccount(undefined)
setTimeout(() => this.events.emit(BeaconEvent.INVALID_ACTIVE_ACCOUNT_STATE))

return
Expand Down

0 comments on commit 55c5bea

Please sign in to comment.