File tree Expand file tree Collapse file tree 1 file changed +5
-8
lines changed
packages/web3/src/ethereum/demos/siwe Expand file tree Collapse file tree 1 file changed +5
-8
lines changed Original file line number Diff line number Diff line change 1- import { Account , ConnectButton , Connector } from '@ant-design/web3' ;
1+ import { Account , ConnectButton , Connector , useConnection } from '@ant-design/web3' ;
22import {
33 MetaMask ,
44 OkxWallet ,
@@ -10,22 +10,19 @@ import {
1010import { QueryClient } from '@tanstack/react-query' ;
1111import { Button , Space } from 'antd' ;
1212import { createSiweMessage } from 'viem/siwe' ;
13- import { http , useDisconnect } from 'wagmi' ;
13+ import { http } from 'wagmi' ;
1414
1515import { getNonce , verifyMessage } from './mock-api' ;
1616
1717const queryClient = new QueryClient ( ) ;
1818
1919const DisconnectBtn : React . FC = ( ) => {
20- const { disconnect } = useDisconnect ( ) ;
20+ const { disconnect } = useConnection ( ) ;
21+
2122 return (
2223 < Button
2324 onClick = { ( ) => {
24- disconnect ( undefined , {
25- onError : ( e : any ) => {
26- console . error ( e ?. shortMessage || 'Disconnect Failed' ) ;
27- } ,
28- } ) ;
25+ disconnect ?.( ) ;
2926 } }
3027 danger
3128 >
You can’t perform that action at this time.
0 commit comments