From dbd0fd197323f2a83fab384d7b4b116a02165d16 Mon Sep 17 00:00:00 2001
From: xuatz <xzlow10@gmail.com>
Date: Sun, 18 May 2025 17:21:11 +0900
Subject: fix(search): add new relevance sort order (#1392)

* fix(search): add new relevance sort order

* address pr comments

* some minor fixes

---------

Co-authored-by: Mohamed Bassem <me@mbassem.com>
---
 apps/web/app/dashboard/search/page.tsx | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

(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 beae73b8..c3542a88 100644
--- a/apps/web/app/dashboard/search/page.tsx
+++ b/apps/web/app/dashboard/search/page.tsx
@@ -1,14 +1,22 @@
 "use client";
 
-import { Suspense } from "react";
+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 { useSortOrderStore } from "@/lib/store/useSortOrderStore";
 
 function SearchComp() {
   const { data, hasNextPage, fetchNextPage, isFetchingNextPage } =
     useBookmarkSearch();
 
+  const { setSortOrder } = useSortOrderStore();
+
+  useEffect(() => {
+    // also see related cleanup code in SortOrderToggle.tsx
+    setSortOrder("relevance");
+  }, []);
+
   return (
     <div className="flex flex-col gap-3">
       {data ? (
-- 
cgit v1.2.3-70-g09d2

