File tree 2 files changed +6
-4
lines changed
2 files changed +6
-4
lines changed Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " @web3-onboard/react" ,
3
- "version" : " 2.1.2 " ,
3
+ "version" : " 2.1.3 " ,
4
4
"description" : " Collection of React Hooks for web3-onboard" ,
5
5
"module" : " dist/index.js" ,
6
6
"browser" : " dist/index.js" ,
Original file line number Diff line number Diff line change @@ -75,7 +75,7 @@ export const useSetChain = (
75
75
connectedChain : ConnectedChain | null
76
76
settingChain : boolean
77
77
} ,
78
- ( options : SetChainOptions ) => Promise < void >
78
+ ( options : SetChainOptions ) => Promise < boolean >
79
79
] => {
80
80
if ( ! web3Onboard ) throw new Error ( 'Must initialize before using hooks.' )
81
81
@@ -108,12 +108,14 @@ export const useSetChain = (
108
108
return ( ) => subscription . unsubscribe ( )
109
109
} , [ ] )
110
110
111
- const set = useCallback ( async ( options : SetChainOptions ) => {
111
+ const set = useCallback ( async ( options : SetChainOptions ) : Promise < boolean > => {
112
112
setInProgress ( true )
113
113
114
- await setChain ( { ...options , wallet : walletLabel } )
114
+ const success = await setChain ( { ...options , wallet : walletLabel } )
115
115
116
116
setInProgress ( false )
117
+
118
+ return success ;
117
119
} , [ ] )
118
120
119
121
return [ { chains, connectedChain, settingChain } , set ]
You can’t perform that action at this time.
0 commit comments