Skip to content

Commit

Permalink
fix: ensure TxConfirmationModal displays correct txHash after disable…
Browse files Browse the repository at this point in the history
…Renewal (#884)
  • Loading branch information
YanYuanFE authored Sep 23, 2024
1 parent 466bf2b commit b59245a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion components/identities/actions/identityActions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ const IdentityActions: FunctionComponent<IdentityActionsProps> = ({
const encodedDomains = utils.encodeDomain(identity?.domain);
const { addTransaction } = useNotificationManager();
const [isTxModalOpen, setIsTxModalOpen] = useState(false);
const [txHash, setTxHash] = useState<string>('');
const [viewMoreClicked, setViewMoreClicked] = useState<boolean>(false);
const [isMainDomain, setIsMainDomain] = useState<boolean>(
identity ? identity.isMain : false
Expand Down Expand Up @@ -159,6 +160,7 @@ const IdentityActions: FunctionComponent<IdentityActionsProps> = ({
status: "pending",
},
});
setTxHash(mainDomainData.transaction_hash);
setIsTxModalOpen(true);
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [mainDomainData]);
Expand Down Expand Up @@ -199,6 +201,7 @@ const IdentityActions: FunctionComponent<IdentityActionsProps> = ({
status: "pending",
},
});
setTxHash(disableRenewalData.transaction_hash);
setIsTxModalOpen(true);
posthog?.capture("disable-ar"); // track events for analytics
// eslint-disable-next-line react-hooks/exhaustive-deps
Expand Down Expand Up @@ -360,7 +363,7 @@ const IdentityActions: FunctionComponent<IdentityActionsProps> = ({
domain={identity?.domain}
/>
<TxConfirmationModal
txHash={mainDomainData?.transaction_hash}
txHash={txHash}
isTxModalOpen={isTxModalOpen}
closeModal={() => setIsTxModalOpen(false)}
title="Your Transaction is on it's way !"
Expand Down

0 comments on commit b59245a

Please sign in to comment.