From cf06bbb2b56690ccfe29e36cbde0d8a68ad04bad Mon Sep 17 00:00:00 2001
From: MohamedBassem <me@mbassem.com>
Date: Sun, 24 Aug 2025 01:33:20 +0300
Subject: fix(web): fix query getting rest when bookmark preview is closed.
 fixes #1521

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

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

diff --git a/apps/web/app/dashboard/search/page.tsx b/apps/web/app/dashboard/search/page.tsx
index c3542a88..930ad6bb 100644
--- a/apps/web/app/dashboard/search/page.tsx
+++ b/apps/web/app/dashboard/search/page.tsx
@@ -4,12 +4,15 @@ import { Suspense, useEffect } from "react";
 import BookmarksGrid from "@/components/dashboard/bookmarks/BookmarksGrid";
 import { FullPageSpinner } from "@/components/ui/full-page-spinner";
 import { useBookmarkSearch } from "@/lib/hooks/bookmark-search";
+import { useInSearchPageStore } from "@/lib/store/useInSearchPageStore";
 import { useSortOrderStore } from "@/lib/store/useSortOrderStore";
 
 function SearchComp() {
   const { data, hasNextPage, fetchNextPage, isFetchingNextPage } =
     useBookmarkSearch();
 
+  const { setInSearchPage } = useInSearchPageStore();
+
   const { setSortOrder } = useSortOrderStore();
 
   useEffect(() => {
@@ -17,6 +20,11 @@ function SearchComp() {
     setSortOrder("relevance");
   }, []);
 
+  useEffect(() => {
+    setInSearchPage(true);
+    return () => setInSearchPage(false);
+  }, [setInSearchPage]);
+
   return (
     <div className="flex flex-col gap-3">
       {data ? (
-- 
cgit v1.2.3-70-g09d2

