Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,14 @@ changes.

### Fixed

- Fix app crash on unhandled wallet error [Issue 3123](https://github.com/IntersectMBO/govtool/issues/3123)

### Changed

### Removed

## [v2.0.21](https://github.com/IntersectMBO/govtool/releases/tag/v2.0.21) 2025-05-09


### Added

- Add support for the tables in markdown [Issue 3581](https://github.com/IntersectMBO/govtool/issues/3581)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ export const StatusModal = forwardRef<HTMLDivElement>((_, ref) => {
whiteSpace: "pre-line",
}}
>
{state?.message}{" "}
{typeof state?.message === "string" && state?.message}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Originally there was a space after the message, do we want to keep it?

{state?.link && (
<Link
onClick={() => openInNewTab(state?.link || "")}
Expand Down
5 changes: 4 additions & 1 deletion govtool/frontend/src/hooks/useWalletErrorModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,10 @@ export const useWalletErrorModal = () => {
buttonText,
dataTestId,
}: WalletErrorModalProps) => {
const errorMessage = (error && typeof error === 'object' && 'info' in error) ? error.info : error;
const errorMessage =
error && typeof error === "object" && "info" in error
? error.info
: JSON.stringify(error, Object.getOwnPropertyNames(error));
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[context]
Some of the wallets' errors contain info key, but the javascript's errors (throw new Error("Whoops!")) contain a message key.
We could support both, but as for that the safest option is just to make sure that we return a string. Possibly after further requests we will consider how exactly to handle it, because maybe there is some other type of error that we have not defined


openModal({
type: "statusModal",
Expand Down
Loading