Skip to content

Commit

Permalink
fix: list
Browse files Browse the repository at this point in the history
  • Loading branch information
IsaccoSordo committed May 22, 2024
1 parent 2439031 commit 5f1c2a4
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions src/docs/getting-started/subscribe-to-active-account.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ Be aware that calling one of the functions listed below will also trigger `ACTIV
- `disconnect`
- `removeAccount`
- `removeAllAccounts`
- `destroy`

## Example

Expand Down Expand Up @@ -79,7 +80,7 @@ Sometimes `requestPermissions` may not be enough, and you want to ensure the use
dAppClient.subscribeToEvent(BeaconEvent.ACTIVE_ACCOUNT_SET, async (account) => {
console.log(
`${BeaconEvent.ACTIVE_ACCOUNT_SET} triggered: `,
account?.address,
account?.address
);

if (!account) {
Expand Down Expand Up @@ -107,7 +108,7 @@ wallet.client.subscribeToEvent(
async (account) => {
console.log(
`${BeaconEvent.ACTIVE_ACCOUNT_SET} triggered: `,
account?.address,
account?.address
);

if (!account) {
Expand All @@ -123,7 +124,7 @@ wallet.client.subscribeToEvent(
// The request was rejected
// handle disconnection
}
},
}
);
```

Expand Down Expand Up @@ -208,7 +209,7 @@ Now, inside the handler, check whether the current tab has the leadership. If no
dAppClient.subscribeToEvent(BeaconEvent.ACTIVE_ACCOUNT_SET, async (account) => {
console.log(
`${BeaconEvent.ACTIVE_ACCOUNT_SET} triggered: `,
account?.address,
account?.address
);

if (!account || !elector.isLeader) {
Expand Down Expand Up @@ -236,7 +237,7 @@ wallet.client.subscribeToEvent(
async (account) => {
console.log(
`${BeaconEvent.ACTIVE_ACCOUNT_SET} triggered: `,
account?.address,
account?.address
);

if (!account || !elector.isLeader) {
Expand All @@ -252,7 +253,7 @@ wallet.client.subscribeToEvent(
// The request was rejected
// handle disconnection
}
},
}
);
```

Expand Down Expand Up @@ -297,7 +298,7 @@ const dAppClient = new DAppClient({
dAppClient.subscribeToEvent(BeaconEvent.ACTIVE_ACCOUNT_SET, async (account) => {
console.log(
`${BeaconEvent.ACTIVE_ACCOUNT_SET} triggered: `,
account?.address,
account?.address
);

if (!account || !elector.isLeader) {
Expand Down Expand Up @@ -342,7 +343,7 @@ wallet.client.subscribeToEvent(
async (account) => {
console.log(
`${BeaconEvent.ACTIVE_ACCOUNT_SET} triggered: `,
account?.address,
account?.address
);

if (!account || !elector.isLeader) {
Expand All @@ -358,7 +359,7 @@ wallet.client.subscribeToEvent(
// The request was rejected
// handle disconnection
}
},
}
);
```

Expand Down

0 comments on commit 5f1c2a4

Please sign in to comment.