From 14fb5a9b5c91dbbf472e2a1c19c5795ee6acc0b2 Mon Sep 17 00:00:00 2001 From: "Timothy J. Baek" Date: Tue, 21 Nov 2023 08:32:22 -0800 Subject: [PATCH] fix: sidebar open by default --- src/lib/components/layout/Sidebar.svelte | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/lib/components/layout/Sidebar.svelte b/src/lib/components/layout/Sidebar.svelte index 1980a552e..979437421 100644 --- a/src/lib/components/layout/Sidebar.svelte +++ b/src/lib/components/layout/Sidebar.svelte @@ -28,6 +28,10 @@ } onMount(async () => { + if (window.innerWidth > 1280) { + show = true; + } + await chats.set(await $db.getAllFromIndex('chats', 'timestamp')); }); @@ -166,7 +170,7 @@ bind:this={navElement} class="h-screen {show ? '' - : '-translate-x-[260px]'} w-[260px] fixed top-0 left-0 z-40 transition bg-[#0a0a0a] text-gray-200 shadow-2xl text-sm + : '-translate-x-[260px]'} w-[260px] fixed top-0 left-0 z-40 transition bg-[#0a0a0a] text-gray-200 shadow-2xl text-sm " >