feat: refine home section navigation

This commit is contained in:
TerryM
2026-05-28 16:07:08 +08:00
parent 9d977be2d2
commit e0240f6217
4 changed files with 33 additions and 30 deletions

View File

@@ -19,10 +19,9 @@ export function PostRedirect() {
if (POST_STREAM_USES_MOCK) {
const post = MOCK_POSTS.find((p) => p.id === id);
navigate(
post ? `/category/${post.categorySlug}#post-${post.id}` : "/browse",
{ replace: true },
);
navigate(post ? `/browse#post-${post.id}` : "/browse", {
replace: true,
});
return;
}
@@ -30,7 +29,7 @@ export function PostRedirect() {
`/api/posts/${id}?lang=${encodeURIComponent(langQuery(lang))}`,
)
.then((post) => {
navigate(`/category/${post.categorySlug}#post-${post.id}`, {
navigate(`/browse#post-${post.id}`, {
replace: true,
});
})