From 6e060da237af35796b1b34dce108f05eef44ceb3 Mon Sep 17 00:00:00 2001
From: Sebastian <sebasjm@gmail.com>
Date: Fri, 14 Apr 2023 14:16:08 -0300
Subject: some changes

using transaction context from web utils
alertContext.safely api change (easier to integrate)
using lang and localstorage from web utils
removing auto permission, from UI
adding settings
---
 .../src/wallet/Transaction.tsx                      | 21 +++++++--------------
 1 file changed, 7 insertions(+), 14 deletions(-)

(limited to 'packages/taler-wallet-webextension/src/wallet/Transaction.tsx')

diff --git a/packages/taler-wallet-webextension/src/wallet/Transaction.tsx b/packages/taler-wallet-webextension/src/wallet/Transaction.tsx
index d34e57f58..1ef0f0b79 100644
--- a/packages/taler-wallet-webextension/src/wallet/Transaction.tsx
+++ b/packages/taler-wallet-webextension/src/wallet/Transaction.tsx
@@ -61,7 +61,7 @@ import {
 import { Time } from "../components/Time.js";
 import { alertFromError, useAlertContext } from "../context/alert.js";
 import { useBackendContext } from "../context/backend.js";
-import { useTranslationContext } from "../context/translation.js";
+import { useTranslationContext } from "@gnu-taler/web-util/lib/index.browser";
 import { useAsyncAsHook } from "../hooks/useAsyncAsHook.js";
 import { Button } from "../mui/Button.js";
 import { SafeHandler } from "../mui/handlers.js";
@@ -283,10 +283,7 @@ function TransactionTemplate({
                 <Button
                   variant="contained"
                   color="error"
-                  onClick={safely(
-                    onDelete,
-                    i18n.str`Could not forget transaction`,
-                  )}
+                  onClick={safely("delete transaction", onDelete)}
                 >
                   <i18n.Translate>Confirm</i18n.Translate>
                 </Button>
@@ -322,10 +319,7 @@ function TransactionTemplate({
                 <Button
                   variant="contained"
                   color="error"
-                  onClick={safely(
-                    onCancel,
-                    i18n.str`Could not cancel the active transaction`,
-                  )}
+                  onClick={safely("cancel active transaction", onCancel)}
                 >
                   <i18n.Translate>Yes</i18n.Translate>
                 </Button>
@@ -340,7 +334,7 @@ function TransactionTemplate({
           {showSend ? (
             <Button
               variant="contained"
-              onClick={safely(onSend, i18n.str`Could not send`)}
+              onClick={safely("send transaction", onSend)}
             >
               <i18n.Translate>Send</i18n.Translate>
             </Button>
@@ -350,7 +344,7 @@ function TransactionTemplate({
           {showRetry ? (
             <Button
               variant="contained"
-              onClick={safely(onRetry, i18n.str`Could not retry`)}
+              onClick={safely("retry transaction", onRetry)}
             >
               <i18n.Translate>Retry</i18n.Translate>
             </Button>
@@ -627,9 +621,8 @@ export function TransactionView({
                 <div>
                   <Button
                     variant="contained"
-                    onClick={safely(
-                      () => onRefund(transaction.proposalId),
-                      i18n.str`Could not refund`,
+                    onClick={safely("refund transaction", () =>
+                      onRefund(transaction.proposalId),
                     )}
                   >
                     <i18n.Translate>Accept</i18n.Translate>
-- 
cgit v1.2.3

