Format sidebar allocation fix
Co-authored-by: Julius Marminge <[email protected]> Co-authored-by: codex <[email protected]>
This commit is contained in:
1 parent
a504c7bf88
commit
02ea090cb4
1 file changed
+20
-14
@@ -3247,22 +3247,28 @@ export default function Sidebar() {
|
||||
}, []);
|
||||
|
||||
const animatedProjectLists = useMemo(() => new WeakSet<HTMLElement>(), []);
|
||||
const attachProjectListAutoAnimateRef = useCallback((node: HTMLElement | null) => {
|
||||
if (!node || animatedProjectLists.has(node)) {
|
||||
return;
|
||||
}
|
||||
autoAnimate(node, SIDEBAR_LIST_ANIMATION_OPTIONS);
|
||||
animatedProjectLists.add(node);
|
||||
}, [animatedProjectLists]);
|
||||
const attachProjectListAutoAnimateRef = useCallback(
|
||||
(node: HTMLElement | null) => {
|
||||
if (!node || animatedProjectLists.has(node)) {
|
||||
return;
|
||||
}
|
||||
autoAnimate(node, SIDEBAR_LIST_ANIMATION_OPTIONS);
|
||||
animatedProjectLists.add(node);
|
||||
},
|
||||
[animatedProjectLists],
|
||||
);
|
||||
|
||||
const animatedThreadLists = useMemo(() => new WeakSet<HTMLElement>(), []);
|
||||
const attachThreadListAutoAnimateRef = useCallback((node: HTMLElement | null) => {
|
||||
if (!node || animatedThreadLists.has(node)) {
|
||||
return;
|
||||
}
|
||||
autoAnimate(node, SIDEBAR_LIST_ANIMATION_OPTIONS);
|
||||
animatedThreadLists.add(node);
|
||||
}, [animatedThreadLists]);
|
||||
const attachThreadListAutoAnimateRef = useCallback(
|
||||
(node: HTMLElement | null) => {
|
||||
if (!node || animatedThreadLists.has(node)) {
|
||||
return;
|
||||
}
|
||||
autoAnimate(node, SIDEBAR_LIST_ANIMATION_OPTIONS);
|
||||
animatedThreadLists.add(node);
|
||||
},
|
||||
[animatedThreadLists],
|
||||
);
|
||||
|
||||
const visibleThreads = useMemo(
|
||||
() => sidebarThreads.filter((thread) => thread.archivedAt === null),
|
||||
|
||||
Reference in new issue
Block a user