mirror of
https://github.com/actualbudget/actual.git
synced 2026-04-29 02:54:09 -05:00
Fixed a bug where it was possible to make a transfer to the same account as the one making the transfer. (#1038)
The payee autocomplete was always using cached accounts. Added a check to see if accounts was already passed in as a parameter - only using cached if it wasnt.
This commit is contained in:
@@ -403,6 +403,7 @@ function PayeeCell({
|
||||
|
||||
// Filter out the account we're currently in as it is not a valid transfer
|
||||
accounts = accounts.filter(account => account.id !== accountId);
|
||||
payees = payees.filter(payee => payee.transfer_acct !== accountId);
|
||||
|
||||
return (
|
||||
<CustomCell
|
||||
|
||||
@@ -181,10 +181,19 @@ export default function PayeeAutocomplete({
|
||||
onUpdate,
|
||||
onSelect,
|
||||
onManagePayees,
|
||||
accounts,
|
||||
payees,
|
||||
...props
|
||||
}) {
|
||||
let payees = useCachedPayees();
|
||||
let accounts = useCachedAccounts();
|
||||
let cachedPayees = useCachedPayees();
|
||||
if (!payees) {
|
||||
payees = cachedPayees;
|
||||
}
|
||||
|
||||
let cachedAccounts = useCachedAccounts();
|
||||
if (!accounts) {
|
||||
accounts = cachedAccounts;
|
||||
}
|
||||
|
||||
let [focusTransferPayees, setFocusTransferPayees] = useState(
|
||||
defaultFocusTransferPayees,
|
||||
|
||||
6
upcoming-release-notes/1038.md
Normal file
6
upcoming-release-notes/1038.md
Normal file
@@ -0,0 +1,6 @@
|
||||
---
|
||||
category: Bugfix
|
||||
authors: [Miodec]
|
||||
---
|
||||
|
||||
Fixed a bug where it was possible to make a transfer to the same account as the one making the transfer.
|
||||
Reference in New Issue
Block a user