File tree Expand file tree Collapse file tree 2 files changed +6
-1
lines changed
web-marketplace/src/lib/wallet Expand file tree Collapse file tree 2 files changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -18,6 +18,7 @@ type Props = {
1818 setConnectionType : UseStateSetter < string | undefined > ;
1919 walletConfigRef : MutableRefObject < WalletConfig | undefined > ;
2020 logout ?: ( ) => Promise < void > ;
21+ setWalletConnect : UseStateSetter < boolean > ;
2122} ;
2223
2324export type DisconnectType = ( ) => Promise < void > ;
@@ -28,12 +29,14 @@ export const useDisconnect = ({
2829 setWallet,
2930 walletConfigRef,
3031 logout,
32+ setWalletConnect,
3133} : Props ) : DisconnectType => {
3234 const { mainWallet } = useWallet ( KEPLR_MOBILE ) ;
3335
3436 const disconnect = useCallback ( async ( ) : Promise < void > => {
3537 if ( walletConnect && mainWallet ) {
3638 await mainWallet . disconnect ( true ) ;
39+ setWalletConnect ( false ) ;
3740 }
3841
3942 setWallet ( emptySender ) ;
@@ -47,11 +50,12 @@ export const useDisconnect = ({
4750 if ( ! walletConnect && logout ) await logout ( ) ;
4851 } , [
4952 walletConnect ,
53+ mainWallet ,
5054 setWallet ,
5155 setConnectionType ,
5256 walletConfigRef ,
5357 logout ,
54- mainWallet ,
58+ setWalletConnect ,
5559 ] ) ;
5660
5761 return disconnect ;
Original file line number Diff line number Diff line change @@ -174,6 +174,7 @@ export const WalletProvider: React.FC<React.PropsWithChildren<unknown>> = ({
174174 walletConfigRef,
175175 logout,
176176 walletConnect,
177+ setWalletConnect,
177178 } ) ;
178179
179180 useAutoConnect ( {
You can’t perform that action at this time.
0 commit comments