fix(transactions): drop rows reassigned to another account from the account list
The account detail list renders from a static Inertia prop and no longer refetches, and filteredTransactions deliberately bypasses the account filter when scoped to a single account. So editing a transaction and moving it to a different account left the (now optimistically-updated) row visible in the wrong account's list until a full page reload. Add an explicit guard: when scoped to an account, drop any row whose account_id no longer matches.
This commit is contained in:
parent
057e78c3eb
commit
bdffa91bb1
|
|
@ -432,6 +432,13 @@ export function TransactionList({
|
|||
|
||||
const filteredTransactions = useMemo(() => {
|
||||
return transactions.filter((transaction) => {
|
||||
// When scoped to a single account, drop rows that were reassigned to
|
||||
// another account (e.g. via inline edit). The list no longer
|
||||
// refetches, so without this they would linger until a full reload.
|
||||
if (accountId && transaction.account_id !== accountId) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (filters.searchText && !searchMatchedIds.has(transaction.id)) {
|
||||
return false;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue