fix: align popular sorting links
All checks were successful
Deploy to Frontend Servers / deploy (push) Successful in 20s

This commit is contained in:
TerryM
2026-05-28 18:52:01 +08:00
parent 6f901f48e1
commit 15d873be63
2 changed files with 2 additions and 5 deletions

View File

@@ -607,10 +607,7 @@ export function PublicLayout() {
to={popularHref} to={popularHref}
label={t("popular")} label={t("popular")}
icon="update" icon="update"
active={ active={na("browsePopular")}
pathname === "/browse" &&
new URLSearchParams(search).get("tag") === "popular"
}
/> />
</div> </div>
</nav> </nav>

View File

@@ -71,7 +71,7 @@ export function Home() {
getJSON<{ items: Post[] }>(`/api/posts/recommended${postQ}&limit=12`), 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}&sort=latest&limit=12`),
getJSON<{ items: Post[] }>( getJSON<{ items: Post[] }>(
`/api/posts${postQ}&tag=popular&limit=5`, `/api/posts${postQ}&sort=popular&limit=5`,
).catch((): { items: Post[] } => ({ items: [] })), ).catch((): { items: Post[] } => ({ items: [] })),
]) ])
.then(([c, r, l, p]) => { .then(([c, r, l, p]) => {