File tree 3 files changed +3144
-2796
lines changed
3 files changed +3144
-2796
lines changed Original file line number Diff line number Diff line change @@ -110,6 +110,7 @@ export const WalletProvider = (props: WalletProviderProps) => {
110
110
const disconnect = useCallback ( async ( ) => {
111
111
ensureCallable ( walletAdapter , status ) ;
112
112
const adapter = walletAdapter as IWalletAdapter ;
113
+
113
114
// try to clear listeners
114
115
if ( isNonEmptyArray ( walletOffListeners . current ) ) {
115
116
walletOffListeners . current . forEach ( off => {
@@ -121,6 +122,12 @@ export const WalletProvider = (props: WalletProviderProps) => {
121
122
} )
122
123
walletOffListeners . current = [ ] // empty array
123
124
}
125
+
126
+ // clear storage for last connected wallet
127
+ // if users disconnect wallet manually
128
+ const storage = new Storage ( )
129
+ storage . removeItem ( StorageKey . LAST_CONNECT_WALLET_NAME )
130
+
124
131
try {
125
132
// disconnect is an optional action for wallet
126
133
if ( adapter . hasFeature ( FeatureName . STANDARD__DISCONNECT ) ) {
Original file line number Diff line number Diff line change @@ -25,7 +25,7 @@ export function useAutoConnect(
25
25
if ( ! lastConnectedWalletName ) return
26
26
27
27
if ( allAvailableWallets . find ( item => item . name == lastConnectedWalletName ) ) {
28
- console . log ( 'auto connect to wallet:' , lastConnectedWalletName )
28
+ // console.log('auto connect to wallet:', lastConnectedWalletName)
29
29
select ( lastConnectedWalletName )
30
30
. then ( ( ) => {
31
31
init . current = true
You can’t perform that action at this time.
0 commit comments