Skip to content
Snippets Groups Projects
Unverified Commit ec5e98b9 authored by Jack's avatar Jack Committed by GitHub
Browse files

Fixed a bug where it was possible to make a transfer to the same account as...

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.
parent 18e3a162
No related branches found
No related tags found
No related merge requests found
......@@ -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,
......
---
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.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment