aboutsummaryrefslogtreecommitdiff
path: root/packages/demobank-ui/src/pages/QrCodeSection.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'packages/demobank-ui/src/pages/QrCodeSection.tsx')
-rw-r--r--packages/demobank-ui/src/pages/QrCodeSection.tsx20
1 files changed, 16 insertions, 4 deletions
diff --git a/packages/demobank-ui/src/pages/QrCodeSection.tsx b/packages/demobank-ui/src/pages/QrCodeSection.tsx
index 8948827aa..9ae1cf268 100644
--- a/packages/demobank-ui/src/pages/QrCodeSection.tsx
+++ b/packages/demobank-ui/src/pages/QrCodeSection.tsx
@@ -56,17 +56,29 @@ export function QrCodeSection({
async function doAbort() {
await withRuntimeErrorHandling(i18n, async () => {
- const result = await api.abortWithdrawalById(withdrawUri.withdrawalOperationId);
- if (result.type === "ok") {
+ const resp = await api.abortWithdrawalById(withdrawUri.withdrawalOperationId);
+ if (resp.type === "ok") {
onAborted();
} else {
- switch (result.case) {
+ switch (resp.case) {
case "previously-confirmed": return notify({
type: "info",
title: i18n.str`The reserve operation has been confirmed previously and can't be aborted`
})
+ case "invalid-id": return notify({
+ type: "error",
+ title: i18n.str`The operation id is invalid.`,
+ description: resp.detail.hint as TranslatedString,
+ debug: resp.detail,
+ })
+ case "not-found": return notify({
+ type: "error",
+ title: i18n.str`The operation was not found.`,
+ description: resp.detail.hint as TranslatedString,
+ debug: resp.detail,
+ })
default: {
- assertUnreachable(result.case)
+ assertUnreachable(resp)
}
}
}