Fix sidebar hidden state being updated too frequently

This commit is contained in:
Gregory Schier
2026-01-03 14:29:18 -08:00
parent 35a57bf7f5
commit c75d6b815e

View File

@@ -73,14 +73,14 @@ export function Workspace() {
const newWidth = startWidth.current + (x - xStart);
if (newWidth < 50) {
await setSidebarHidden(true);
if (!sidebarHidden) await setSidebarHidden(true);
resetWidth();
} else {
await setSidebarHidden(false);
if (sidebarHidden) await setSidebarHidden(false);
setWidth(newWidth);
}
},
[width, setSidebarHidden, resetWidth, setWidth],
[width, sidebarHidden, setSidebarHidden, resetWidth, setWidth],
);
const handleResizeStart = useCallback(() => {