mirror of
https://github.com/actualbudget/actual.git
synced 2026-03-11 20:44:32 -05:00
[Mobile] Fix "Category budget has been updated to ..." notification even when the budget was not updated (#4200)
* Fix FocusableAmountInput's onUpdate to only fire when amount was updated * Release notes
This commit is contained in:
committed by
GitHub
parent
6cbf3e33e6
commit
dd2b0a8bd5
@@ -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 => {
|
||||
|
||||
@@ -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(
|
||||
@@ -788,6 +786,7 @@ const TransactionEditInner = memo(function TransactionEditInner({
|
||||
zeroSign="-"
|
||||
focused={totalAmountFocused}
|
||||
onFocus={onTotalAmountEdit}
|
||||
onBlur={onClearActiveEdit}
|
||||
onUpdateAmount={onTotalAmountUpdate}
|
||||
focusedStyle={{
|
||||
width: 'auto',
|
||||
|
||||
6
upcoming-release-notes/4200.md
Normal file
6
upcoming-release-notes/4200.md
Normal file
@@ -0,0 +1,6 @@
|
||||
---
|
||||
category: Bugfix
|
||||
authors: [joel-jeremy]
|
||||
---
|
||||
|
||||
Fix FocusableAmountInput's onUpdate to only fire when amount was updated
|
||||
Reference in New Issue
Block a user