@@ -22,6 +22,7 @@ import { ConnectWallet } from 'modules/migration/components/ConnectWallet';
22
22
import { NewDelegateContract } from 'modules/migration/components/NewDelegateContract' ;
23
23
import { sign } from 'modules/web3/helpers/sign' ;
24
24
import { useLinkedDelegateInfo } from 'modules/migration/hooks/useLinkedDelegateInfo' ;
25
+ import { useHasV1VoteDelegate } from 'modules/delegates/hooks/useHasV2VoteDelegate' ;
25
26
26
27
export default function DelegateMigrationPage ( ) : React . ReactElement {
27
28
const { account, provider } = useWeb3 ( ) ;
@@ -38,7 +39,9 @@ export default function DelegateMigrationPage(): React.ReactElement {
38
39
latestOwnerHasDelegateContract
39
40
} = useLinkedDelegateInfo ( ) ;
40
41
41
- const connectedAddressFound = ! ! originalOwnerAddress || ! ! latestOwnerAddress ;
42
+ //if latest is a v1 delegate contract, then they still haven't started the v2 linking process
43
+ const { data : latestIsV1Delegate } = useHasV1VoteDelegate ( latestOwnerAddress ) ;
44
+ const connectedAddressFound = ( ! ! originalOwnerAddress || ! ! latestOwnerAddress ) && ! latestIsV1Delegate ;
42
45
43
46
// the user should be shown the steps to take action if:
44
47
// a - the connected account needs to migrate to v2
@@ -53,7 +56,7 @@ export default function DelegateMigrationPage(): React.ReactElement {
53
56
54
57
const getCurrentStep = useMemo ( ( ) : string => {
55
58
// delegate contract is v1 and we don't have
56
- // a request to migrate the address yet, show migration info
59
+ // a request to migrate the address to v2 yet, show migration info
57
60
if (
58
61
( isDelegateV1Contract ) &&
59
62
! connectedAddressFound &&
@@ -72,7 +75,7 @@ export default function DelegateMigrationPage(): React.ReactElement {
72
75
return STEPS . NEW_ADDRESS ;
73
76
}
74
77
75
- // delegate contract is either expired or expiring or needs to migrate to v2
78
+ // delegate contract needs to migrate to v2
76
79
// and we have processed the request to migrate
77
80
// but user is connected with old address
78
81
if (
0 commit comments