|
@@ -8,13 +8,13 @@ import {
|
|
|
useCurrentSidebarContents,
|
|
useCurrentSidebarContents,
|
|
|
useCurrentProductNavWidth,
|
|
useCurrentProductNavWidth,
|
|
|
useSidebarResizeDisabled,
|
|
useSidebarResizeDisabled,
|
|
|
- putUserUISettings,
|
|
|
|
|
} from '~/stores/ui';
|
|
} from '~/stores/ui';
|
|
|
|
|
|
|
|
import DrawerToggler from './Navbar/DrawerToggler';
|
|
import DrawerToggler from './Navbar/DrawerToggler';
|
|
|
|
|
|
|
|
import SidebarNav from './Sidebar/SidebarNav';
|
|
import SidebarNav from './Sidebar/SidebarNav';
|
|
|
import SidebarContents from './Sidebar/SidebarContents';
|
|
import SidebarContents from './Sidebar/SidebarContents';
|
|
|
|
|
+import { scheduleToPutUserUISettings } from '~/services/user-ui-settings';
|
|
|
|
|
|
|
|
const sidebarMinWidth = 240;
|
|
const sidebarMinWidth = 240;
|
|
|
const sidebarMinimizeWidth = 20;
|
|
const sidebarMinimizeWidth = 20;
|
|
@@ -34,7 +34,7 @@ const GlobalNavigation = () => {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
mutateSidebarCollapsed(newValue, false);
|
|
mutateSidebarCollapsed(newValue, false);
|
|
|
- putUserUISettings({ isSidebarCollapsed: newValue });
|
|
|
|
|
|
|
+ scheduleToPutUserUISettings({ isSidebarCollapsed: newValue });
|
|
|
|
|
|
|
|
}, [currentContents, isCollapsed, mutateSidebarCollapsed]);
|
|
}, [currentContents, isCollapsed, mutateSidebarCollapsed]);
|
|
|
|
|
|
|
@@ -209,7 +209,7 @@ const Sidebar: FC<Props> = (props: Props) => {
|
|
|
const toggleNavigationBtnClickHandler = useCallback(() => {
|
|
const toggleNavigationBtnClickHandler = useCallback(() => {
|
|
|
const newValue = !isCollapsed;
|
|
const newValue = !isCollapsed;
|
|
|
mutateSidebarCollapsed(newValue, false);
|
|
mutateSidebarCollapsed(newValue, false);
|
|
|
- putUserUISettings({ isSidebarCollapsed: newValue });
|
|
|
|
|
|
|
+ scheduleToPutUserUISettings({ isSidebarCollapsed: newValue });
|
|
|
}, [isCollapsed, mutateSidebarCollapsed]);
|
|
}, [isCollapsed, mutateSidebarCollapsed]);
|
|
|
|
|
|
|
|
useEffect(() => {
|
|
useEffect(() => {
|
|
@@ -243,12 +243,12 @@ const Sidebar: FC<Props> = (props: Props) => {
|
|
|
// force collapsed
|
|
// force collapsed
|
|
|
mutateSidebarCollapsed(true, false);
|
|
mutateSidebarCollapsed(true, false);
|
|
|
mutateProductNavWidth(sidebarMinWidth, false);
|
|
mutateProductNavWidth(sidebarMinWidth, false);
|
|
|
- putUserUISettings({ isSidebarCollapsed: true, currentProductNavWidth: sidebarMinWidth });
|
|
|
|
|
|
|
+ scheduleToPutUserUISettings({ isSidebarCollapsed: true, currentProductNavWidth: sidebarMinWidth });
|
|
|
}
|
|
}
|
|
|
else {
|
|
else {
|
|
|
const newWidth = resizableContainer.current.clientWidth;
|
|
const newWidth = resizableContainer.current.clientWidth;
|
|
|
mutateProductNavWidth(newWidth, false);
|
|
mutateProductNavWidth(newWidth, false);
|
|
|
- putUserUISettings({ currentProductNavWidth: newWidth });
|
|
|
|
|
|
|
+ scheduleToPutUserUISettings({ currentProductNavWidth: newWidth });
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
resizableContainer.current.classList.remove('dragging');
|
|
resizableContainer.current.classList.remove('dragging');
|