Explorar el Código

refac: remember sidebar status

Timothy J. Baek hace 7 meses
padre
commit
a860e98ab9
Se han modificado 1 ficheros con 5 adiciones y 1 borrados
  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();