@@ -31,6 +31,7 @@ const DAORecord = ({
3131} ) => {
3232 const [ t ] = useTranslation ( )
3333 const [ withdrawValue , setWithdrawValue ] = useState ( '' )
34+ const [ withdrawingEpoch , setWithdrawingEpoch ] = useState ( '' )
3435 const [ depositEpoch , setDepositEpoch ] = useState ( '' )
3536
3637 useEffect ( ( ) => {
@@ -69,7 +70,15 @@ const DAORecord = ({
6970 . catch ( ( err : Error ) => {
7071 console . error ( err )
7172 } )
72- } , [ daoData , depositOutPoint ] )
73+
74+ getBlockByNumber ( BigInt ( blockNumber ) )
75+ . then ( b => {
76+ setWithdrawingEpoch ( b . header . epoch )
77+ } )
78+ . catch ( ( err : Error ) => {
79+ console . error ( err )
80+ } )
81+ } , [ daoData , depositOutPoint , blockNumber ] )
7382
7483 const interest = BigInt ( withdrawValue ) - BigInt ( capacity )
7584
@@ -83,7 +92,8 @@ const DAORecord = ({
8392 } else {
8493 const depositEpochInfo = epochParser ( depositEpoch )
8594 const currentEpochInfo = epochParser ( epoch )
86- const targetEpochNumber = calculateClaimEpochNumber ( depositEpochInfo , currentEpochInfo )
95+ const withdrawingEpochInfo = epochParser ( withdrawingEpoch )
96+ const targetEpochNumber = calculateClaimEpochNumber ( depositEpochInfo , withdrawingEpochInfo )
8797 if ( targetEpochNumber <= currentEpochInfo . number ) {
8898 metaInfo = 'Ready'
8999 ready = true
0 commit comments