-
Notifications
You must be signed in to change notification settings - Fork 11.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
wallet-ext,wallet-adapters,wallet-kit-core: handle disconnecting dapp using wallet #7258
wallet-ext,wallet-adapters,wallet-kit-core: handle disconnecting dapp using wallet #7258
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
1 Ignored Deployment
|
2edfa1e
to
ee40c67
Compare
ee40c67
to
c4b7f7d
Compare
c4b7f7d
to
2cdce7c
Compare
2cdce7c
to
f77f88a
Compare
#wallet: StandardWalletAdapterWallet; | ||
|
||
constructor({ wallet }: StandardWalletAdapterConfig) { | ||
this.#wallet = wallet; | ||
this.#wallet.features["standard:events"].on( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not convinced this should be listened for here vs in wallet kit. I'm curious why you ended up listening here?
Also, if we do keep the listen here, it probably makes more sense to set this up in connect
instead of the constructor?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had to do it to update the connected field. But also WalletAdapter
interface seems to kind of isolate the wallet from wallet-kit, and thought maybe it's better to add the extra WalletAdapterEvents
so adapters can have extra events instead of just exposing the wallet feature. But happy to change it if you have something else in mind.
Also, if we do keep the listen here, it probably makes more sense to set this up in connect instead of the constructor?
I will move it
f77f88a
to
3873fb4
Compare
3873fb4
to
0076cd3
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me.
SignableTransaction, | ||
SuiAddress, | ||
SuiTransactionResponse, | ||
} from "@mysten/sui.js"; | ||
|
||
export interface WalletAdapterEvents { | ||
changed(changes: { connected?: boolean; accounts?: SuiAddress[] }): void; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe change
to align more with tense of other events?
* emit change events when connected status changes
* handle the case when user disconnects from the dapp using the wallet, and update the wallet-kit state as well
* address PR comment
0076cd3
to
8b966e3
Compare
fix the case where user disconnects from a dapp using the wallet and wallet-kit was staying in connected state
Screen.Recording.2023-01-11.at.17.49.49.mov
part of APPS-308