feat: refine home section navigation
This commit is contained in:
@@ -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,
|
||||
});
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user