From bccb69f370a63d95099dcc5054ac10ca09ac8c84 Mon Sep 17 00:00:00 2001
From: Owen Jacobson <owen@grimoire.ca>
Date: Sun, 3 Nov 2024 09:43:38 -0500
Subject: Generalize menu-closing

---
 ui/routes/+layout.svelte | 5 +++++
 1 file changed, 5 insertions(+)

(limited to 'ui/routes/+layout.svelte')

diff --git a/ui/routes/+layout.svelte b/ui/routes/+layout.svelte
index da205d3..e0355dd 100644
--- a/ui/routes/+layout.svelte
+++ b/ui/routes/+layout.svelte
@@ -1,4 +1,5 @@
 <script>
+	import { onNavigate } from '$app/navigation';
 	import '../app.css';
 	import logo from '$lib/assets/logo.png';
 
@@ -10,6 +11,10 @@
 	function toggleMenu() {
 		showMenu.update((value) => !value);
 	}
+
+	onNavigate(() => {
+		showMenu.update(() => false);
+	});
 </script>
 
 <div id="app" class="m-0 p-0 h-vh w-full">
-- 
cgit v1.2.3

