Timothy Jaeryang Baek 5 months ago
parent
commit
0c6f22b20b

+ 2 - 0
src/lib/components/layout/SearchModal.svelte

@@ -14,6 +14,7 @@
 	dayjs.extend(calendar);
 
 	export let show = false;
+	export let onClose = () => {};
 
 	let query = '';
 	let page = 1;
@@ -137,6 +138,7 @@
 						draggable="false"
 						on:click={() => {
 							show = false;
+							onClose();
 						}}
 					>
 						<div class=" flex-1">

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

@@ -432,7 +432,14 @@
 	/>
 {/if}
 
-<SearchModal bind:show={$showSearch} />
+<SearchModal
+	bind:show={$showSearch}
+	onClose={() => {
+		if ($mobile) {
+			showSidebar.set(false);
+		}
+	}}
+/>
 
 <div
 	bind:this={navElement}