fix: use instance.data instead of profile.data.instance, fix SSR handoff crash

This commit is contained in:
James Xylight committed 2025-02-17 12:50:52 -08:00
1 parent 04ffad9483
commit 99acddf7ed
8 files changed
+46 -15

No files matched your search

+2 -1
View File
@@ -1,4 +1,5 @@
import { profile } from '$lib/auth.svelte'
import { instance } from '$lib/instance.svelte'
import { client } from '$lib/lemmy.svelte.js'
import type { View } from '$lib/settings.svelte'
import { isImage, isVideo } from '$lib/ui/image'
@@ -61,7 +62,7 @@ export const isYoutubeLink = (url?: string): RegExpMatchArray | null => {
}
export const postLink = (post: Post) =>
`/post/${encodeURIComponent(profile.data.instance)}/${post.id}`
`/post/${encodeURIComponent(instance.data)}/${post.id}`
export type MediaType = 'video' | 'image' | 'iframe' | 'embed' | 'none'
export type IframeType = 'youtube' | 'video' | 'none'