fix: unmerged posts/comments in user profiles

This commit is contained in:
James Xylight committed 2025-06-06 17:07:58 -07:00
1 parent c7f3c17001
commit 681cef0634
4 files changed
+124 -3

No files matched your search

+7 -2
View File
@@ -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}`,
)
}