From 34e2fd51e038d26c9ea1c0c6770148640669518f Mon Sep 17 00:00:00 2001
From: Sebastian <sebasjm@gmail.com>
Date: Tue, 20 Jun 2023 17:50:30 -0300
Subject: add select max amount

---
 packages/taler-wallet-webextension/src/components/AmountField.tsx | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

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

diff --git a/packages/taler-wallet-webextension/src/components/AmountField.tsx b/packages/taler-wallet-webextension/src/components/AmountField.tsx
index 432aa6af1..c330c72b5 100644
--- a/packages/taler-wallet-webextension/src/components/AmountField.tsx
+++ b/packages/taler-wallet-webextension/src/components/AmountField.tsx
@@ -24,7 +24,7 @@ import {
   TranslatedString,
 } from "@gnu-taler/taler-util";
 import { Fragment, h, VNode } from "preact";
-import { useState } from "preact/hooks";
+import { useEffect, useState } from "preact/hooks";
 import { useTranslationContext } from "@gnu-taler/web-util/browser";
 import { AmountFieldHandler } from "../mui/handlers.js";
 import { TextField } from "../mui/TextField.js";
@@ -56,6 +56,9 @@ export function AmountField({
   const previousValue = Amounts.stringifyValue(normal);
 
   const [textValue, setTextValue] = useState<string>(previousValue);
+  useEffect(() => {
+    setTextValue(previousValue);
+  }, [previousValue]);
 
   function updateUnit(newUnit: number) {
     setUnit(newUnit);
-- 
cgit v1.2.3

