From d260c3c3fa073d1a9d09b94c5c4749334e26ab9a Mon Sep 17 00:00:00 2001
From: crupest <crupest@outlook.com>
Date: Sun, 10 Apr 2022 19:07:42 +0800
Subject: ...

---
 FrontEnd/src/views/search/index.tsx | 16 +++++++++-------
 1 file changed, 9 insertions(+), 7 deletions(-)

(limited to 'FrontEnd/src/views/search/index.tsx')

diff --git a/FrontEnd/src/views/search/index.tsx b/FrontEnd/src/views/search/index.tsx
index 60eb6306..e1d3222d 100644
--- a/FrontEnd/src/views/search/index.tsx
+++ b/FrontEnd/src/views/search/index.tsx
@@ -15,16 +15,15 @@ import "./index.css";
 const TimelineSearchResultItemView: React.FC<{
   timeline: HttpTimelineInfo;
 }> = ({ timeline }) => {
-  const link = timeline.name.startsWith("@")
-    ? `users/${timeline.owner.username}`
-    : `timelines/${timeline.name}`;
-
   return (
     <div className="timeline-search-result-item my-2 p-3">
       <h4>
-        <Link to={link} className="mb-2 text-primary">
+        <Link
+          to={`${timeline.owner.username}/${timeline.nameV2}`}
+          className="mb-2 text-primary"
+        >
           {timeline.title}
-          <small className="ms-3 text-secondary">{timeline.name}</small>
+          <small className="ms-3 text-secondary">{timeline.nameV2}</small>
         </Link>
       </h4>
       <div>
@@ -117,7 +116,10 @@ const SearchPage: React.FC = () => {
               return <div>{t("searchPage.noResult")}</div>;
             }
             return state.map((t) => (
-              <TimelineSearchResultItemView key={t.name} timeline={t} />
+              <TimelineSearchResultItemView
+                key={`${t.owner.username}/${t.nameV2}`}
+                timeline={t}
+              />
             ));
           }
         }
-- 
cgit v1.2.3

