diff --git a/src/components/layout/Sidebar.tsx b/src/components/layout/Sidebar.tsx index 9f8fc99..f47fbe2 100644 --- a/src/components/layout/Sidebar.tsx +++ b/src/components/layout/Sidebar.tsx @@ -45,8 +45,8 @@ const Sidebar = ({ const [sidebarBodyRef, { height: sidebarBodyHeight }] = useMeasure(); const getSidebarWidth = useCallback((num: number) => { - if (num < 160) { - return 160; + if (num < 165) { + return 165; } if (num > 400) { @@ -64,7 +64,9 @@ const Sidebar = ({ const handleResizeEnd = useCallback( (e: MouseEvent) => { if (isResizing) { - dispatch(setSidebar({ width: `${getSidebarWidth(e?.clientX)}px` })); + const finalWidth = `${getSidebarWidth(e?.clientX)}px`; + dispatch(setSidebar({ width: finalWidth })); + settings.setSync('sidebar.width', finalWidth); setIsResizing(false); document.body.style.cursor = 'default'; } diff --git a/src/redux/configSlice.ts b/src/redux/configSlice.ts index 2ed21c9..e76bff7 100644 --- a/src/redux/configSlice.ts +++ b/src/redux/configSlice.ts @@ -170,9 +170,9 @@ const initialState: ConfigPage = { alignment: String(parsedSettings.gridAlignment), }, sidebar: { - expand: Boolean(parsedSettings.sidebar?.expand) || true, - width: String(parsedSettings.sidebar?.width) || '225px', - coverArt: Boolean(parsedSettings.sidebar?.coverArt) || true, + expand: Boolean(parsedSettings.sidebar?.expand), + width: String(parsedSettings.sidebar?.width), + coverArt: Boolean(parsedSettings.sidebar?.coverArt), selected: parsedSettings.sidebar?.selected || [ 'dashboard', 'nowplaying',