diff options
Diffstat (limited to 'packages/web-util/src/components/Button.tsx')
-rw-r--r-- | packages/web-util/src/components/Button.tsx | 4 |
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", |