mirror of
https://github.com/actualbudget/actual.git
synced 2026-04-30 10:14:53 -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) => {
|
const onUpdate = (value: string) => {
|
||||||
props.onUpdate?.(value);
|
const originalAmount = Math.abs(props.value);
|
||||||
const amount = applyText();
|
const amount = applyText();
|
||||||
props.onUpdateAmount?.(amount);
|
if (amount !== originalAmount) {
|
||||||
|
props.onUpdate?.(value);
|
||||||
|
props.onUpdateAmount?.(amount);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const onBlur: HTMLProps<HTMLInputElement>['onBlur'] = e => {
|
const onBlur: HTMLProps<HTMLInputElement>['onBlur'] = e => {
|
||||||
|
|||||||
@@ -584,11 +584,9 @@ const TransactionEditInner = memo(function TransactionEditInner({
|
|||||||
value => {
|
value => {
|
||||||
if (transaction.amount !== value) {
|
if (transaction.amount !== value) {
|
||||||
onUpdateInner(transaction, 'amount', value.toString());
|
onUpdateInner(transaction, 'amount', value.toString());
|
||||||
} else {
|
|
||||||
onClearActiveEdit();
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
[onClearActiveEdit, onUpdateInner, transaction],
|
[onUpdateInner, transaction],
|
||||||
);
|
);
|
||||||
|
|
||||||
const onEditFieldInner = useCallback(
|
const onEditFieldInner = useCallback(
|
||||||
@@ -788,6 +786,7 @@ const TransactionEditInner = memo(function TransactionEditInner({
|
|||||||
zeroSign="-"
|
zeroSign="-"
|
||||||
focused={totalAmountFocused}
|
focused={totalAmountFocused}
|
||||||
onFocus={onTotalAmountEdit}
|
onFocus={onTotalAmountEdit}
|
||||||
|
onBlur={onClearActiveEdit}
|
||||||
onUpdateAmount={onTotalAmountUpdate}
|
onUpdateAmount={onTotalAmountUpdate}
|
||||||
focusedStyle={{
|
focusedStyle={{
|
||||||
width: 'auto',
|
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