Skip to content

Commit

Permalink
Use client for listening wallet events
Browse files Browse the repository at this point in the history
  • Loading branch information
tolgahan-arikan committed Sep 22, 2023
1 parent 7605d55 commit 46ca133
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,12 @@ const App = () => {

useEffect(() => {
// Wallet events
wallet.on('disconnect', () => {
console.log('wallet disconnected')
disconnect() // optional method, but useful in this example
wallet.client.onOpen(() => {
console.log('wallet window opened')
})

wallet.client.onClose(() => {
console.log('wallet window closed')
})
}, [wallet])

Expand Down

0 comments on commit 46ca133

Please sign in to comment.