mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-11-19 06:58:24 +01:00
Fix sidebar hidden state being updated too frequently
This commit is contained in:
1 parent
35a57bf7f5
commit
c75d6b815e
1 file changed
+3
-3
@@ -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(() => {
|
||||
|
||||
Reference in new issue
Block a user