Skip to content

Commit c322fab

Browse files
authored
Merge pull request #2697 from IntersectMBO/fix/2408-blank-screen-appears-when-delegatingregistering-drep-with-a-wallet-lacking-utxos
fix(#2408): fix blank screen on registering as a DRep
2 parents 906c070 + 10b3ebb commit c322fab

File tree

8 files changed

+9
-14
lines changed

8 files changed

+9
-14
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ changes.
1717
### Fixed
1818

1919
- Fix usage of trim on missing label
20+
- Fix blank screen when registering as a DRep [Issue 2408](https://github.com/IntersectMBO/govtool/issues/2408)
2021

2122
### Changed
2223

govtool/frontend/src/components/organisms/RegisterAsDRepSteps/WhatRetirementMeans.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ export const WhatRetirementMeans = ({
7272
} catch (error: any) {
7373
Sentry.captureException(error);
7474
openWalletErrorModal({
75-
error,
75+
error: error?.message ? error.message : JSON.stringify(error),
7676
onSumbit: onClickCancel,
7777
buttonText: t("modals.common.goToDashboard"),
7878
dataTestId: "retirement-transaction-error-modal",

govtool/frontend/src/hooks/forms/useEditDRepInfoForm.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ export const useEditDRepInfoForm = (
176176
Sentry.captureException(error);
177177

178178
openWalletErrorModal({
179-
error,
179+
error: error?.message ? error.message : JSON.stringify(error),
180180
onSumbit: () => backToDashboard(),
181181
dataTestId: "edit-drep-transaction-error-modal",
182182
});

govtool/frontend/src/hooks/forms/useRegisterAsdRepForm.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ export const useRegisterAsdRepForm = (
216216
});
217217
} else {
218218
openWalletErrorModal({
219-
error,
219+
error: error?.message ? error.message : JSON.stringify(error),
220220
onSumbit: () => backToDashboard(),
221221
dataTestId: "registration-transaction-error-modal",
222222
});

govtool/frontend/src/hooks/forms/useVoteActionForm.tsx

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import { useForm, useWatch } from "react-hook-form";
33
import * as Yup from "yup";
44
import { yupResolver } from "@hookform/resolvers/yup";
55
import { useLocation, useNavigate, useParams } from "react-router-dom";
6-
import * as Sentry from "@sentry/react";
76

87
import { PATHS } from "@consts";
98
import { useCardano, useSnackbar } from "@context";
@@ -106,8 +105,6 @@ export const useVoteActionForm = ({
106105
});
107106
}
108107
} catch (error) {
109-
Sentry.setTag("hook", "useVoteActionForm");
110-
Sentry.captureException(error);
111108
openWalletErrorModal({
112109
error,
113110
dataTestId: "vote-transaction-error-modal",

govtool/frontend/src/hooks/useDelegateToDrep.ts

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -50,13 +50,10 @@ export const useDelegateTodRep = () => {
5050
resourceId: dRepId,
5151
voter,
5252
});
53-
} catch (error) {
54-
console.error({ error });
53+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
54+
} catch (error: any) {
5555
openWalletErrorModal({
56-
error:
57-
typeof error === "string"
58-
? error
59-
: (error as { message: string | null })?.message,
56+
error: error?.message ? error.message : JSON.stringify(error),
6057
dataTestId: "delegate-transaction-error-modal",
6158
});
6259
} finally {

govtool/frontend/src/pages/RegisterAsDirectVoter.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ export const RegisterAsDirectVoter = () => {
8686
// eslint-disable-next-line @typescript-eslint/no-explicit-any
8787
} catch (error: any) {
8888
openWalletErrorModal({
89-
error,
89+
error: error?.message ? error.message : JSON.stringify(error),
9090
buttonText: t("modals.common.goToDashboard"),
9191
onSumbit: () => navigate(PATHS.dashboard),
9292
dataTestId: "registration-transaction-error-modal",

govtool/frontend/src/pages/RetireAsDirectVoter.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ export const RetireAsDirectVoter = () => {
6161
// eslint-disable-next-line @typescript-eslint/no-explicit-any
6262
} catch (error: any) {
6363
openWalletErrorModal({
64-
error,
64+
error: error?.message ? error.message : JSON.stringify(error),
6565
buttonText: t("modals.common.goToDashboard"),
6666
onSumbit: () => navigate(PATHS.dashboard),
6767
dataTestId: "retirement-transaction-error-modal",

0 commit comments

Comments
 (0)