fix: received invoices — show skeleton only on initial load, not on sort/filter

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
BOHA
2026-03-23 11:03:22 +01:00
parent 0ad88aa5ce
commit e0fbae1530

View File

@@ -155,7 +155,7 @@ export default function ReceivedInvoices({ statsMonth, statsYear, uploadOpen, se
// Fetch list
const fetchList = useCallback(async () => {
setLoading(true)
if (!hasLoadedOnce.current) setLoading(true)
try {
const params = new URLSearchParams({
month: String(statsMonth),
@@ -171,6 +171,7 @@ export default function ReceivedInvoices({ statsMonth, statsYear, uploadOpen, se
}
} catch { /* ignore */ } finally {
setLoading(false)
hasLoadedOnce.current = true
}
}, [statsMonth, statsYear, search, sort, order])