misc: change $instance to a $state

This commit is contained in:
James Xylight committed 2025-02-09 11:36:04 -08:00
1 parent 8dcca84e60
commit d8e916d526
26 files changed
+54 -48

No files matched your search

@@ -32,7 +32,7 @@
import { Select, removeToast, toast } from 'mono-svelte'
import type { CommentSortType, GetCommentsResponse } from 'lemmy-js-client'
import { profile } from '$lib/auth.svelte.js'
import { instance } from '$lib/instance.js'
import { instance } from '$lib/instance.svelte.js'
import { afterNavigate, goto } from '$app/navigation'
import FormattedNumber from '$lib/components/util/FormattedNumber.svelte'
import { Button } from 'mono-svelte'
@@ -145,7 +145,7 @@
if (res.post) {
removeToast(id)
goto(`/post/${$instance}/${res.post.post.id}`, {}).then(() =>
goto(`/post/${instance.data}/${res.post.post.id}`, {}).then(() =>
removeToast(id),
)
}
@@ -176,7 +176,7 @@
let commenting = $state(false)
let remoteView = $derived(
page.params.instance?.toLowerCase() != $instance.toLowerCase(),
page.params.instance?.toLowerCase() != instance.data.toLowerCase(),
)
</script>
@@ -5,7 +5,7 @@
import CommentListVirtualizer from '$lib/components/lemmy/comment/CommentListVirtualizer.svelte'
import { buildCommentsTree } from '$lib/components/lemmy/comment/comments.svelte'
import EndPlaceholder from '$lib/components/ui/EndPlaceholder.svelte'
import { instance } from '$lib/instance'
import { instance } from '$lib/instance.svelte'
import { settings } from '$lib/settings.svelte'
import { t } from '$lib/translations'
import type {
@@ -94,7 +94,7 @@
.map((c) => c.community.id)
.includes(post.community_view.community.id)
)) ||
page.params.instance.toLowerCase() != $instance.toLowerCase()}
page.params.instance.toLowerCase() != instance.data.toLowerCase()}
banned={post.community_view.banned_from_community}
onfocus={() => (commenting = true)}
tools={commenting}