Skip to content

Commit

Permalink
Merge pull request #638 from airgap-it/fix/setActiveAccount
Browse files Browse the repository at this point in the history
fix: updateActiveAccount
  • Loading branch information
AndreasGassmann authored Nov 3, 2023
2 parents a5b7e4a + c21c052 commit ea6a893
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 15 deletions.
12 changes: 0 additions & 12 deletions packages/beacon-dapp/src/dapp-client/DAppClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -431,18 +431,6 @@ export class DAppClient extends Client {
ClientEvents.WC_ACK_NOTIFICATION,
this.wcToastHandler.bind(this)
)
this.walletConnectTransport.setEventHandler(
ClientEvents.UPDATE_ACCOUNT,
this.updateActiveAccountHandler.bind(this)
)
}

private async updateActiveAccountHandler(address?: string) {
if (address && this._activeAccount.isResolved()) {
let account = await this._activeAccount.promise
account && (account.address = address)
account && (await this.setActiveAccount(account))
}
}

private async wcToastHandler() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -527,9 +527,6 @@ export class WalletConnectCommunicationClient extends CommunicationClient {
throw new Error('Public key for the new account not provided')
}

const fun = this.eventHandlers.get(ClientEvents.UPDATE_ACCOUNT)
fun && fun(this.activeAccount)

this.notifyListeners(session.pairingTopic, {
id: await generateGUID(),
type: BeaconMessageType.ChangeAccountRequest,
Expand Down

0 comments on commit ea6a893

Please sign in to comment.