From 539513587c5507dbd9f3c94a1d59b8d1889b954a Mon Sep 17 00:00:00 2001 From: Konstantin Lukas Date: Mon, 9 Sep 2024 18:52:04 +0200 Subject: [PATCH] adjust language of default category label when creating a new standing order and changing the language --- src/components/StandingOrders.tsx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/components/StandingOrders.tsx b/src/components/StandingOrders.tsx index 0f4c4f7..e06feef 100644 --- a/src/components/StandingOrders.tsx +++ b/src/components/StandingOrders.tsx @@ -62,6 +62,7 @@ export default function StandingOrders({closeStandingOrders, openAccount}: { }); const [datePickerOpen, setDatePickerOpen] = useState(false); const [isUsingDefaultName, setIsUsingDefaultName] = useState(true); + const [isUsingDefaultCategory, setIsUsingDefaultCategory] = useState(true); const [standingOrders, setStandingOrders] = useState([]); const standingOrderElements = useMemo(() => { if (standingOrders.length === 0) { @@ -92,6 +93,8 @@ export default function StandingOrders({closeStandingOrders, openAccount}: { useEffect(() => { if (isUsingDefaultName) setAddOrderState({type: 'name', payload: text.new_standing_order_}) + if (isUsingDefaultCategory) + setAddOrderState({type: 'category', payload: text.new_standing_order_}) }, [text]); const backAnim = useCallback((path: string, target: string) => { @@ -148,6 +151,7 @@ export default function StandingOrders({closeStandingOrders, openAccount}: { { setAddOrderState({type: 'category', payload: (e.target as HTMLInputElement).value}); + setIsUsingDefaultCategory(false); }} value={addOrderState.category} />