From d483a3f5574355ed9c43eb6ddea59e5734323cf0 Mon Sep 17 00:00:00 2001
From: Sebastian <sebasjm@gmail.com>
Date: Wed, 19 Apr 2023 12:42:47 -0300
Subject: fix #7704

---
 .../taler-wallet-webextension/src/wallet/Transaction.tsx  | 15 ++++++---------
 1 file changed, 6 insertions(+), 9 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 1ef0f0b79..9bcae8997 100644
--- a/packages/taler-wallet-webextension/src/wallet/Transaction.tsx
+++ b/packages/taler-wallet-webextension/src/wallet/Transaction.tsx
@@ -34,6 +34,7 @@ import {
   WithdrawalType,
 } from "@gnu-taler/taler-util";
 import { WalletApiOperation } from "@gnu-taler/taler-wallet-core";
+import { useTranslationContext } from "@gnu-taler/web-util/lib/index.browser";
 import { styled } from "@linaria/react";
 import { differenceInSeconds, isPast } from "date-fns";
 import { ComponentChildren, Fragment, h, VNode } from "preact";
@@ -43,7 +44,6 @@ import { Amount } from "../components/Amount.js";
 import { BankDetailsByPaytoType } from "../components/BankDetailsByPaytoType.js";
 import { CopyButton } from "../components/CopyButton.js";
 import { AlertView, ErrorAlertView } from "../components/CurrentAlerts.js";
-import { JustInDevMode } from "../components/JustInDevMode.js";
 import { Loading } from "../components/Loading.js";
 import { Kind, Part, PartCollapsible, PartPayto } from "../components/Part.js";
 import { QR } from "../components/QR.js";
@@ -61,12 +61,12 @@ import {
 import { Time } from "../components/Time.js";
 import { alertFromError, useAlertContext } from "../context/alert.js";
 import { useBackendContext } from "../context/backend.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";
 import { Pages } from "../NavigationBar.js";
 import { assertUnreachable } from "../utils/index.js";
+import { EnabledBySettings } from "../components/EnabledBySettings.js";
 
 interface Props {
   tid: string;
@@ -359,18 +359,15 @@ function TransactionTemplate({
                 <i18n.Translate>Cancel</i18n.Translate>
               </Button>
             ) : (
-              //WORKAROUND
-              //Able to delete tx in dev mode
-              //FIXME: remove this when DD37 is implemented
-              <JustInDevMode>
+              <EnabledBySettings name="deleteActiveTransactions">
                 <Button
                   variant="contained"
                   color="error"
                   onClick={doCheckBeforeForget as SafeHandler<void>}
                 >
-                  <i18n.Translate>Forget</i18n.Translate>
+                  <i18n.Translate>Delete</i18n.Translate>
                 </Button>
-              </JustInDevMode>
+              </EnabledBySettings>
             )
           ) : (
             <Button
@@ -378,7 +375,7 @@ function TransactionTemplate({
               color="error"
               onClick={doCheckBeforeForget as SafeHandler<void>}
             >
-              <i18n.Translate>Forget</i18n.Translate>
+              <i18n.Translate>Delete</i18n.Translate>
             </Button>
           )}
         </div>
-- 
cgit v1.2.3

