Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Mobile] Fix "Category budget has been updated to ..." notification even when the budget was not updated #4200

Merged
merged 2 commits into from
Jan 20, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,12 @@ const AmountInput = memo(function AmountInput({
};

const onUpdate = (value: string) => {
props.onUpdate?.(value);
const originalAmount = Math.abs(props.value);
const amount = applyText();
props.onUpdateAmount?.(amount);
if (amount !== originalAmount) {
props.onUpdate?.(value);
props.onUpdateAmount?.(amount);
}
};

const onBlur: HTMLProps<HTMLInputElement>['onBlur'] = e => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -584,11 +584,9 @@ const TransactionEditInner = memo(function TransactionEditInner({
value => {
if (transaction.amount !== value) {
onUpdateInner(transaction, 'amount', value.toString());
} else {
onClearActiveEdit();
}
},
[onClearActiveEdit, onUpdateInner, transaction],
[onUpdateInner, transaction],
);

const onEditFieldInner = useCallback(
Expand Down Expand Up @@ -788,6 +786,7 @@ const TransactionEditInner = memo(function TransactionEditInner({
zeroSign="-"
focused={totalAmountFocused}
onFocus={onTotalAmountEdit}
onBlur={onClearActiveEdit}
onUpdateAmount={onTotalAmountUpdate}
focusedStyle={{
width: 'auto',
Expand Down
6 changes: 6 additions & 0 deletions upcoming-release-notes/4200.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
category: Bugfix
authors: [joel-jeremy]
---

Fix FocusableAmountInput's onUpdate to only fire when amount was updated
Loading