@@ -7,10 +7,9 @@ import {
77 useGoBack ,
88 useOnWindowResize ,
99 calculateFee ,
10- useClearGeneratedTx ,
1110} from 'utils'
1211import appState from 'states/init/app'
13- import { useState as useGlobalState , useDispatch } from 'states'
12+ import { useState as useGlobalState } from 'states'
1413import MultisigAddressCreateDialog from 'components/MultisigAddressCreateDialog'
1514import MultisigAddressInfo from 'components/MultisigAddressInfo'
1615import SendFromMultisigDialog from 'components/SendFromMultisigDialog'
@@ -39,6 +38,7 @@ import {
3938 DAODeposit ,
4039 DAOWithdrawal ,
4140} from 'widgets/Icons/icon'
41+ import { getHeader } from 'services/chain'
4242import AttentionCloseDialog from 'widgets/Icons/Attention.png'
4343import { HIDE_BALANCE , NetworkType } from 'utils/const'
4444import { onEnter } from 'utils/inputDevice'
@@ -148,8 +148,6 @@ const MultisigAddress = () => {
148148 } )
149149 const [ showDeleteDialog , setShowDeleteDialog ] = useState ( false )
150150 const { suggestFeeRate } = useGetCountDownAndFeeRateStats ( )
151- const clearGeneratedTx = useClearGeneratedTx ( )
152- const dispatch = useDispatch ( )
153151 const [ globalAPC , setGlobalAPC ] = useState ( 0 )
154152 const [ genesisBlockTimestamp , setGenesisBlockTimestamp ] = useState < number | undefined > ( undefined )
155153 const [ notice , setNotice ] = useState ( '' )
@@ -257,13 +255,15 @@ const MultisigAddress = () => {
257255 useOnWindowResize ( updateTipPosition )
258256
259257 const genesisBlockHash = useMemo ( ( ) => networks . find ( v => v . id === networkID ) ?. genesisHash , [ networkID , networks ] )
260- hooks . useInitData ( {
261- clearGeneratedTx,
262- dispatch,
263- wallet,
264- setGenesisBlockTimestamp,
265- genesisBlockHash,
266- } )
258+
259+ useEffect ( ( ) => {
260+ if ( genesisBlockHash ) {
261+ getHeader ( genesisBlockHash )
262+ . then ( header => setGenesisBlockTimestamp ( + header . timestamp ) )
263+ . catch ( err => console . error ( err ) )
264+ }
265+ } , [ ] )
266+
267267 hooks . useUpdateGlobalAPC ( { bestKnownBlockTimestamp, genesisBlockTimestamp, setGlobalAPC } )
268268
269269 const fee = `${ shannonToCKBFormatter (
0 commit comments