auth: rename profile.data -> profile.current
This commit is contained in:
76 files changed
+233
-224
No files matched your search
@@ -7,7 +7,7 @@ export function load({ params }) {
|
||||
redirect(
|
||||
302,
|
||||
resolveRoute(`/post/[instance]/[id]`, {
|
||||
instance: profile.data.instance.toLowerCase(),
|
||||
instance: profile.current.instance.toLowerCase(),
|
||||
id: params.instance,
|
||||
}),
|
||||
)
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
onMount(async () => {
|
||||
if (
|
||||
!(data.post.value.post_view.read && settings.markPostsAsRead) &&
|
||||
profile.data?.jwt
|
||||
profile.current?.jwt
|
||||
) {
|
||||
getClient().markPostAsRead({
|
||||
read: settings.markPostsAsRead,
|
||||
|
||||
@@ -28,7 +28,7 @@ function buildContext(thread?: string) {
|
||||
}
|
||||
|
||||
export async function load({ params, url, fetch }) {
|
||||
if (profile.data.instance != params.instance)
|
||||
if (profile.current.instance != params.instance)
|
||||
redirect(302, resolveRoute('/post/[instance]/[id]/confirm', params))
|
||||
|
||||
// TODO use Lemmy profile default settings
|
||||
|
||||
@@ -51,7 +51,7 @@
|
||||
})
|
||||
</script>
|
||||
|
||||
{#if profile.data?.jwt}
|
||||
{#if profile.current?.jwt}
|
||||
{#if !commenting}
|
||||
<EndPlaceholder>
|
||||
<Button
|
||||
@@ -60,8 +60,8 @@
|
||||
disabled={(post.post_view.post.locked ||
|
||||
post.post_view.banned_from_community) &&
|
||||
!(
|
||||
profile.data?.user?.local_user_view.local_user.admin ||
|
||||
profile.data?.user?.moderates
|
||||
profile.current?.user?.local_user_view.local_user.admin ||
|
||||
profile.current?.user?.moderates
|
||||
.map(c => c.community.id)
|
||||
.includes(post.community_view.community.id)
|
||||
)}
|
||||
@@ -119,7 +119,7 @@
|
||||
{/if}
|
||||
{/if}
|
||||
|
||||
{#if commenting || !profile.data.jwt}
|
||||
{#if commenting || !profile.current.jwt}
|
||||
<div class="gap-2 flex items-center">
|
||||
<Select
|
||||
size="md"
|
||||
|
||||
@@ -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.post) {
|
||||
goto(
|
||||
resolveRoute(`/post/[instance]/[id]`, {
|
||||
instance: profile.data.instance,
|
||||
instance: profile.current.instance,
|
||||
id: res.post.post.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, `/post/${params.instance}/${params.id}`)
|
||||
}
|
||||
Reference in new issue
Block a user