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

@@ -57,6 +57,7 @@
import RelativeDate, {
formatRelativeDate,
} from '$lib/components/util/RelativeDate.svelte'
import { instance } from '$lib/instance.svelte'
let editing = $state(false)
let saving = $state(false)
@@ -327,12 +328,12 @@
onclick={() => {
navigator.share?.({
url: localShare
? `${instanceToURL(profile.data.instance)}/post/${post.post.id}`
? `${instanceToURL(instance.data)}/post/${post.post.id}`
: post.post.ap_id,
}) ??
navigator.clipboard.writeText(
localShare
? `${instanceToURL(profile.data.instance)}/post/${post.post.id}`
? `${instanceToURL(instance.data)}/post/${post.post.id}`
: post.post.ap_id,
)
toast({ content: $t('toast.copied') })