diff --git a/govtool/frontend/src/components/organisms/DashboardCards.tsx b/govtool/frontend/src/components/organisms/DashboardCards.tsx index 8eb669fd5..d8ec4bccb 100644 --- a/govtool/frontend/src/components/organisms/DashboardCards.tsx +++ b/govtool/frontend/src/components/organisms/DashboardCards.tsx @@ -213,7 +213,7 @@ export const DashboardCards = () => { formHexToBech32, ]); - const getRegistrationCardDescription = () => { + const getRegistrationCardDescription = useCallback(() => { if (registerTransaction.transactionHash) { switch (registerTransaction.type) { case "retirement": @@ -228,9 +228,14 @@ export const DashboardCards = () => { } else { return t("dashboard.registration.ifYouWant"); } - }; + }, [ + registerTransaction.transactionHash, + registerTransaction.type, + dRep?.isRegistered, + dRep?.wasRegistered, + ]); - const getRegistrationCardTitle = () => { + const getRegistrationCardTitle = useCallback(() => { if (registerTransaction?.transactionHash) { switch (registerTransaction.type) { case "retirement": @@ -247,7 +252,12 @@ export const DashboardCards = () => { } else { return t("dashboard.registration.registerAsDRep"); } - }; + }, [ + registerTransaction?.transactionHash, + registerTransaction.type, + dRep?.isRegistered, + dRep?.wasRegistered, + ]); const renderGovActionSection = useCallback(() => { return (