File tree Expand file tree Collapse file tree 2 files changed +6
-4
lines changed Expand file tree Collapse file tree 2 files changed +6
-4
lines changed Original file line number Diff line number Diff line change 11{
22 "name" : " @web3-onboard/react" ,
3- "version" : " 2.1.2 " ,
3+ "version" : " 2.1.3 " ,
44 "description" : " Collection of React Hooks for web3-onboard" ,
55 "module" : " dist/index.js" ,
66 "browser" : " dist/index.js" ,
Original file line number Diff line number Diff line change @@ -75,7 +75,7 @@ export const useSetChain = (
7575 connectedChain : ConnectedChain | null
7676 settingChain : boolean
7777 } ,
78- ( options : SetChainOptions ) => Promise < void >
78+ ( options : SetChainOptions ) => Promise < boolean >
7979] => {
8080 if ( ! web3Onboard ) throw new Error ( 'Must initialize before using hooks.' )
8181
@@ -108,12 +108,14 @@ export const useSetChain = (
108108 return ( ) => subscription . unsubscribe ( )
109109 } , [ ] )
110110
111- const set = useCallback ( async ( options : SetChainOptions ) => {
111+ const set = useCallback ( async ( options : SetChainOptions ) : Promise < boolean > => {
112112 setInProgress ( true )
113113
114- await setChain ( { ...options , wallet : walletLabel } )
114+ const success = await setChain ( { ...options , wallet : walletLabel } )
115115
116116 setInProgress ( false )
117+
118+ return success ;
117119 } , [ ] )
118120
119121 return [ { chains, connectedChain, settingChain } , set ]
You can’t perform that action at this time.
0 commit comments