From 019080a94b2a432b20a128882c8b031080a0ead7 Mon Sep 17 00:00:00 2001 From: Sebastian Date: Mon, 7 Nov 2022 15:30:48 -0300 Subject: fix link to payto wire --- packages/demobank-ui/src/pages/home/index.tsx | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) (limited to 'packages/demobank-ui/src/pages/home/index.tsx') diff --git a/packages/demobank-ui/src/pages/home/index.tsx b/packages/demobank-ui/src/pages/home/index.tsx index 568f124b6..c71d801bf 100644 --- a/packages/demobank-ui/src/pages/home/index.tsx +++ b/packages/demobank-ui/src/pages/home/index.tsx @@ -367,16 +367,14 @@ type RawPaytoInputType = string; type RawPaytoInputTypeOpt = RawPaytoInputType | undefined; function useRawPaytoInputType( state?: RawPaytoInputType, -): [RawPaytoInputTypeOpt, StateUpdater, boolean] { +): [RawPaytoInputTypeOpt, StateUpdater] { const ret = useLocalStorage("raw-payto-input-state", state); - const [dirty, setDirty] = useState(false); const retObj: RawPaytoInputTypeOpt = ret[0]; const retSetter: StateUpdater = function (val) { const newVal = val instanceof Function ? val(retObj) : val; - setDirty(true); ret[1](newVal); }; - return [retObj, retSetter, dirty]; + return [retObj, retSetter]; } /** @@ -1156,8 +1154,10 @@ function PaytoWireTransfer(Props: any): VNode { const currency = useContext(CurrencyContext); const [pageState, pageStateSetter] = useContext(PageContext); // NOTE: used for go-back button? const [submitData, submitDataSetter] = useWireTransferRequestType(); - const [rawPaytoInput, rawPaytoInputSetter, rawPaytoInputDirty] = - useRawPaytoInputType(); + // const [rawPaytoInput, rawPaytoInputSetter] = useRawPaytoInputType(); + const [rawPaytoInput, rawPaytoInputSetter] = useState( + undefined, + ); const i18n = useTranslator(); const { focus, backendState } = Props; const amountRegex = "^[0-9]+(.[0-9]+)?$"; @@ -1339,7 +1339,7 @@ function PaytoWireTransfer(Props: any): VNode {

{ console.log("switch to raw payto form"); pageStateSetter((prevState: any) => ({ @@ -1374,7 +1374,7 @@ function PaytoWireTransfer(Props: any): VNode { size={50} ref={ref} id="address" - value={rawPaytoInput} + value={rawPaytoInput ?? ""} required placeholder={i18n`payto address`} // pattern={`payto://iban/[A-Z][A-Z][0-9]+?message=[a-zA-Z0-9 ]+&amount=${currency}:[0-9]+(.[0-9]+)?`} @@ -1384,7 +1384,7 @@ function PaytoWireTransfer(Props: any): VNode { />