From 15d873be639f12de0b17e09ed9147ca65830021f Mon Sep 17 00:00:00 2001 From: TerryM Date: Thu, 28 May 2026 18:52:01 +0800 Subject: [PATCH] fix: align popular sorting links --- src/layouts/PublicLayout.tsx | 5 +---- src/pages/Home/index.tsx | 2 +- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/src/layouts/PublicLayout.tsx b/src/layouts/PublicLayout.tsx index 5d26f3a..7ae9dc9 100644 --- a/src/layouts/PublicLayout.tsx +++ b/src/layouts/PublicLayout.tsx @@ -607,10 +607,7 @@ export function PublicLayout() { to={popularHref} label={t("popular")} icon="update" - active={ - pathname === "/browse" && - new URLSearchParams(search).get("tag") === "popular" - } + active={na("browsePopular")} /> diff --git a/src/pages/Home/index.tsx b/src/pages/Home/index.tsx index cbcbe5b..4a9ef62 100644 --- a/src/pages/Home/index.tsx +++ b/src/pages/Home/index.tsx @@ -71,7 +71,7 @@ export function Home() { getJSON<{ items: Post[] }>(`/api/posts/recommended${postQ}&limit=12`), getJSON<{ items: Post[] }>(`/api/posts${postQ}&sort=latest&limit=12`), getJSON<{ items: Post[] }>( - `/api/posts${postQ}&tag=popular&limit=5`, + `/api/posts${postQ}&sort=popular&limit=5`, ).catch((): { items: Post[] } => ({ items: [] })), ]) .then(([c, r, l, p]) => {