From bdffa91bb1c203329103ffbde392eb186f7bb47b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vi=CC=81ctor=20Falco=CC=81n?= Date: Fri, 3 Jul 2026 16:04:03 +0200 Subject: [PATCH] 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. --- resources/js/components/transactions/transaction-list.tsx | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/resources/js/components/transactions/transaction-list.tsx b/resources/js/components/transactions/transaction-list.tsx index d7f8b452..a1a5d088 100644 --- a/resources/js/components/transactions/transaction-list.tsx +++ b/resources/js/components/transactions/transaction-list.tsx @@ -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; }