Skip to content

Commit

Permalink
adjust language of default category label when creating a new standin…
Browse files Browse the repository at this point in the history
…g order and changing the language
  • Loading branch information
konstantin-lukas committed Sep 9, 2024
1 parent 8cb6ae2 commit 5395135
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/components/StandingOrders.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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) => {
Expand Down Expand Up @@ -148,6 +151,7 @@ export default function StandingOrders({closeStandingOrders, openAccount}: {
<Input
onInput={e => {
setAddOrderState({type: 'category', payload: (e.target as HTMLInputElement).value});
setIsUsingDefaultCategory(false);
}}
value={addOrderState.category}
/>
Expand Down

0 comments on commit 5395135

Please sign in to comment.