aboutsummaryrefslogtreecommitdiff
path: root/packages/web-util/src/components/Button.tsx
diff options
context:
space:
mode:
authorSebastian <sebasjm@gmail.com>2024-04-29 11:42:52 -0300
committerSebastian <sebasjm@gmail.com>2024-04-29 11:42:52 -0300
commit4ed3a05fdd97b08085e5a390963f9810b93a75fd (patch)
tree79b9a76aa3af65b83bcd4c77b42845b5c32d9af3 /packages/web-util/src/components/Button.tsx
parent44308fb898372c059cf03a23ad1169d5a6e0c296 (diff)
downloadwallet-core-4ed3a05fdd97b08085e5a390963f9810b93a75fd.tar.xz
create form
Diffstat (limited to 'packages/web-util/src/components/Button.tsx')
-rw-r--r--packages/web-util/src/components/Button.tsx4
1 files changed, 2 insertions, 2 deletions
diff --git a/packages/web-util/src/components/Button.tsx b/packages/web-util/src/components/Button.tsx
index 18cecbdab..b142114e7 100644
--- a/packages/web-util/src/components/Button.tsx
+++ b/packages/web-util/src/components/Button.tsx
@@ -46,7 +46,7 @@ export interface ButtonHandler<T extends OperationResult<A, B>, A, B> {
onClick: () => Promise<T | undefined>;
onNotification: (n: NotificationMessage) => void;
onOperationSuccess: OnOperationSuccesReturnType<T>;
- onOperationFail: OnOperationFailReturnType<T>;
+ onOperationFail?: OnOperationFailReturnType<T>;
onOperationComplete?: () => void;
}
@@ -99,7 +99,7 @@ export function Button<T extends OperationResult<A, B>, A, B>({
if (resp.type === "fail") {
const d = 'detail' in resp ? resp.detail : undefined
- const title = handler.onOperationFail(resp as any);
+ const title = !handler.onOperationFail ? "Unexpected error." as TranslatedString : handler.onOperationFail(resp as any);
handler.onNotification({
title,
type: "error",