mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-04-24 09:38:29 +02:00
Fix sidebar hidden state being updated too frequently
This commit is contained in:
@@ -73,14 +73,14 @@ export function Workspace() {
|
|||||||
|
|
||||||
const newWidth = startWidth.current + (x - xStart);
|
const newWidth = startWidth.current + (x - xStart);
|
||||||
if (newWidth < 50) {
|
if (newWidth < 50) {
|
||||||
await setSidebarHidden(true);
|
if (!sidebarHidden) await setSidebarHidden(true);
|
||||||
resetWidth();
|
resetWidth();
|
||||||
} else {
|
} else {
|
||||||
await setSidebarHidden(false);
|
if (sidebarHidden) await setSidebarHidden(false);
|
||||||
setWidth(newWidth);
|
setWidth(newWidth);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
[width, setSidebarHidden, resetWidth, setWidth],
|
[width, sidebarHidden, setSidebarHidden, resetWidth, setWidth],
|
||||||
);
|
);
|
||||||
|
|
||||||
const handleResizeStart = useCallback(() => {
|
const handleResizeStart = useCallback(() => {
|
||||||
|
|||||||
Reference in New Issue
Block a user