auth: rename profile.data -> profile.current
This commit is contained in:
76 files changed
+233
-224
No files matched your search
@@ -4,11 +4,11 @@ import { client } from '$lib/lemmy.svelte.js'
|
||||
import { redirect } from '@sveltejs/kit'
|
||||
|
||||
export async function load({ params, fetch }) {
|
||||
if (profile.data.instance != params.instance)
|
||||
if (profile.current.instance != params.instance)
|
||||
redirect(302, resolveRoute('/comment/[instance]/[id]/confirm', params))
|
||||
|
||||
const comment = await client({
|
||||
instanceURL: profile.data.instance,
|
||||
instanceURL: profile.current.instance,
|
||||
func: fetch,
|
||||
}).getComment({
|
||||
id: Number(params.id),
|
||||
@@ -16,6 +16,6 @@ export async function load({ params, fetch }) {
|
||||
|
||||
redirect(
|
||||
302,
|
||||
`/post/${profile.data.instance}/${comment.comment_view.post.id}?thread=${comment.comment_view.comment.path}#${comment.comment_view.comment.id}`,
|
||||
`/post/${profile.current.instance}/${comment.comment_view.post.id}?thread=${comment.comment_view.comment.path}#${comment.comment_view.comment.id}`,
|
||||
)
|
||||
}
|
||||
@@ -15,7 +15,7 @@
|
||||
import { Plus } from 'svelte-hero-icons'
|
||||
|
||||
let loading = $state(false)
|
||||
const fetched = $state.snapshot(profile.data.instance)
|
||||
const fetched = $state.snapshot(profile.current.instance)
|
||||
|
||||
async function fetchOnHome() {
|
||||
loading = true
|
||||
@@ -27,7 +27,7 @@
|
||||
if (res.comment) {
|
||||
goto(
|
||||
resolveRoute(`/comment/[instance]/[id]`, {
|
||||
instance: profile.data.instance,
|
||||
instance: profile.current.instance,
|
||||
id: res.comment.comment.id.toString(),
|
||||
}),
|
||||
)
|
||||
@@ -56,7 +56,7 @@
|
||||
</p>
|
||||
</header>
|
||||
<div class="flex flex-row items-center gap-2 flex-wrap">
|
||||
{#if profile.data.jwt}
|
||||
{#if profile.current.jwt}
|
||||
<Button
|
||||
{loading}
|
||||
disabled={loading}
|
||||
|
||||
@@ -2,6 +2,6 @@ import { profile } from '$lib/auth.svelte.js'
|
||||
import { redirect } from '@sveltejs/kit'
|
||||
|
||||
export async function load({ params }) {
|
||||
if (profile.data.instance == params.instance)
|
||||
if (profile.current.instance == params.instance)
|
||||
redirect(302, `/comment/${params.instance}/${params.id}`)
|
||||
}
|
||||
Reference in new issue
Block a user