dev #13

Merged
root merged 8 commits from dev into main 2026-05-14 23:54:55 +03:00
Showing only changes of commit 47f76e47d2 - Show all commits

View File

@@ -53,10 +53,15 @@ export function CategoryGrid({
const [imageOverrides, setImageOverrides] = useState<Map<string, string>>(new Map());
const prefetchedRef = useRef<Set<string>>(new Set());
// Reset stack when input categories prop changes (parent navigation)
// Reset stack when input categories prop changes (parent navigation).
// `t` is intentionally excluded: useTranslation returns a fresh function each
// render, so including it would re-fire the effect on every render and reset
// the stack immediately after handleSelect pushes a child level — making
// parent-category clicks appear to do nothing.
// biome-ignore lint/correctness/useExhaustiveDependencies: t identity is unstable; key is static
useEffect(() => {
setStack([{ id: parentId ?? null, name: t("categories.root"), categories }]);
}, [categories, parentId, t]);
}, [categories, parentId]);
const current = stack[stack.length - 1];
const currentCategories = current.categories;