fix: unmerged posts/comments in user profiles
This commit is contained in:
4 files changed
+124
-3
No files matched your search
@@ -1,9 +1,14 @@
|
||||
import { resolveRoute } from '$app/paths'
|
||||
import { profile } from '$lib/auth.svelte.js'
|
||||
import { client } from '$lib/lemmy.svelte.js'
|
||||
import { redirect } from '@sveltejs/kit'
|
||||
|
||||
export async function load({ params, fetch }) {
|
||||
if (profile.data.instance != params.instance)
|
||||
redirect(302, resolveRoute('/post/[instance]/[id]/confirm', params))
|
||||
|
||||
const comment = await client({
|
||||
instanceURL: params.instance,
|
||||
instanceURL: profile.data.instance,
|
||||
func: fetch,
|
||||
}).getComment({
|
||||
id: Number(params.id),
|
||||
@@ -11,6 +16,6 @@ export async function load({ params, fetch }) {
|
||||
|
||||
redirect(
|
||||
302,
|
||||
`/post/${params.instance}/${comment.comment_view.post.id}?thread=${comment.comment_view.comment.path}#${comment.comment_view.comment.id}`,
|
||||
`/post/${profile.data.instance}/${comment.comment_view.post.id}?thread=${comment.comment_view.comment.path}#${comment.comment_view.comment.id}`,
|
||||
)
|
||||
}
|
||||
Reference in new issue
Block a user