Fix TDZ crash: move expandedCard declaration before useEffect that references it
ci/woodpecker/push/woodpecker Pipeline was successful
ci/woodpecker/push/woodpecker Pipeline was successful
This commit is contained in:
@@ -65,6 +65,8 @@ function HomePage() {
|
||||
totalCopies: cards.reduce((s, c) => s + getTotal(c), 0),
|
||||
}), [cards, getTotal]);
|
||||
|
||||
const expandedCard = cards.find(c => c.id === expandedCardId);
|
||||
|
||||
const filteredCards = useMemo(() => {
|
||||
let result = cards;
|
||||
if (debouncedSearch) {
|
||||
@@ -83,8 +85,6 @@ function HomePage() {
|
||||
return sorted;
|
||||
}, [cards, debouncedSearch, typeFilter, ownedOnly, sortBy, getTotal]);
|
||||
|
||||
const expandedCard = cards.find(c => c.id === expandedCardId);
|
||||
|
||||
if (loading) return <p style={{ padding: '1rem', color: '#666' }}>Loading cards…</p>;
|
||||
if (error) return <p style={{ padding: '1rem', color: '#c04040' }}>Error: {error}</p>;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user