From a3627569466677d3c0f585af3e04b7ce7a14249f Mon Sep 17 00:00:00 2001
From: Mohamed Bassem <me@mbassem.com>
Date: Mon, 14 Jul 2025 00:10:53 +0000
Subject: fix: Clear search history on logout

---
 apps/web/app/logout/page.tsx | 8 ++++++++
 1 file changed, 8 insertions(+)

(limited to 'apps/web/app/logout/page.tsx')

diff --git a/apps/web/app/logout/page.tsx b/apps/web/app/logout/page.tsx
index 0df28978..91ad684d 100644
--- a/apps/web/app/logout/page.tsx
+++ b/apps/web/app/logout/page.tsx
@@ -4,13 +4,21 @@ import { useEffect } from "react";
 import { useRouter } from "next/navigation";
 import { signOut } from "next-auth/react";
 
+import { useSearchHistory } from "@karakeep/shared-react/hooks/search-history";
+
 export default function Logout() {
   const router = useRouter();
+  const { clearHistory } = useSearchHistory({
+    getItem: (k: string) => localStorage.getItem(k),
+    setItem: (k: string, v: string) => localStorage.setItem(k, v),
+    removeItem: (k: string) => localStorage.removeItem(k),
+  });
   useEffect(() => {
     signOut({
       redirect: false,
       callbackUrl: "/",
     }).then((d) => {
+      clearHistory();
       router.push(d.url);
     });
   }, []);
-- 
cgit v1.3-1-g0d28

