Browse Source

refac: remember sidebar status

Timothy J. Baek 7 months ago
parent
commit
a860e98ab9
1 changed files with 5 additions and 1 deletions
  1. 5 1
      src/lib/components/layout/Sidebar.svelte

+ 5 - 1
src/lib/components/layout/Sidebar.svelte

@@ -115,7 +115,11 @@
 			}
 		});
 
-		showSidebar.set(window.innerWidth > BREAKPOINT);
+		showSidebar.set(!$mobile ? localStorage.sidebar === 'true' : false);
+		showSidebar.subscribe((value) => {
+			localStorage.sidebar = value;
+		});
+
 		await pinnedChats.set(await getChatListByTagName(localStorage.token, 'pinned'));
 		await enablePagination();