auth: rename profile.data -> profile.current

This commit is contained in:
James Xylight committed 2025-07-12 10:26:45 -07:00
1 parent 1edad4ac60
commit 36a9631707
76 files changed
+233 -224

No files matched your search

+1 -1
View File
@@ -2,5 +2,5 @@ import { profile } from '$lib/auth.svelte'
import { error } from '@sveltejs/kit'
export function load() {
if (!profile.data.jwt) error(401)
if (!profile.current.jwt) error(401)
}
+2 -2
View File
@@ -14,7 +14,7 @@ import { error } from '@sveltejs/kit'
type ReportListType = 'unread' | 'all'
export async function load({ url, fetch }) {
if (!profile.data.jwt) error(401)
if (!profile.current.jwt) error(401)
const page = Number(url.searchParams.get('page')) || 1
const type: ReportListType =
@@ -30,7 +30,7 @@ export async function load({ url, fetch }) {
community_id: community,
}
const admin = profile.data?.user ? isAdmin(profile!.data.user!) : false
const admin = profile.current?.user ? isAdmin(profile!.data.user!) : false
const [posts, comments, messages] = await Promise.all([
client.listPostReports({
+1 -1
View File
@@ -24,7 +24,7 @@
let resolving = $state(false)
async function resolve() {
if (!profile.data?.jwt || !profile.data.user) return
if (!profile.current?.jwt || !profile.current.user) return
resolving = true
try {
@@ -10,7 +10,7 @@
{$t('nav.communities')}
</Header>
<div class="w-full h-full flex flex-col mt-4">
{#if !profile.data.user}
{#if !profile.current.user}
<div class="mx-auto my-auto">
<Spinner width={24} />
</div>
@@ -20,7 +20,7 @@
rounding="2xl"
class="flex flex-col dark:bg-zinc-950 max-h-[32rem] overflow-auto"
>
{#each profile.data.user.moderates as moderate}
{#each profile.current.user.moderates as moderate}
{@const community = moderate.community}
<div
class="-mx-4 px-4 hover:bg-slate-100 hover:dark:bg-zinc-900 transition-colors duration-75"