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
@@ -5,7 +5,7 @@ import { ReactiveState } from '$lib/promise.svelte.js'
export async function load({ fetch, url }) {
if (!profile) return
const { jwt } = profile.data!
const { jwt } = profile.current!
if (!jwt) return
const page = Number(url.searchParams.get('page')) || 1
@@ -33,7 +33,7 @@
let reviewing = $state(false)
async function review(approve: boolean) {
if (!profile.data?.jwt) return
if (!profile.current?.jwt) return
let registrationApplicationAnswer: ApproveRegistrationApplication = {
approve: approve,
@@ -67,7 +67,7 @@
type: 'success',
})
application.creator_local_user.accepted_application = approve
application.admin = profile.data.user!.local_user_view.person
application.admin = profile.current.user!.local_user_view.person
application.registration_application.deny_reason = denyReason
$notifications.applications -= 1
+1 -1
View File
@@ -42,7 +42,7 @@
)
async function save() {
if (!profile.data?.jwt) return
if (!profile.current?.jwt) return
saving = true
+2 -2
View File
@@ -44,7 +44,7 @@
if (instance == '') return
await trycatch(async () => {
if (
!profile.data?.jwt ||
!profile.current?.jwt ||
!data.federated_instances?.federated_instances?.blocked ||
!data.federated_instances?.federated_instances?.allowed
)
@@ -81,7 +81,7 @@
const save = async () => {
const res = await trycatch(async () => {
if (
!profile.data?.jwt ||
!profile.current?.jwt ||
!data.federated_instances?.federated_instances?.blocked
)
return
+1 -1
View File
@@ -3,7 +3,7 @@ import { client } from '$lib/lemmy.svelte.js'
import { ReactiveState } from '$lib/promise.svelte.js'
export async function load({ fetch, url }) {
const { jwt } = profile.data
const { jwt } = profile.current
const page = Number(url.searchParams.get('page')) || 1
+1 -1
View File
@@ -23,7 +23,7 @@
let saving = $state(false)
async function save() {
if (!profile.data?.jwt) return
if (!profile.current?.jwt) return
saving = true
+2 -2
View File
@@ -29,7 +29,7 @@
action: () => removeAdmin(id, true),
})
if (!profile.data?.jwt) return
if (!profile.current?.jwt) return
const result = await trycatch(() =>
getClient().addAdmin({
@@ -77,7 +77,7 @@
class="flex flex-row items-center gap-2 mt-auto w-full"
onsubmit={preventDefault(() => {
trycatch(async () => {
if (!profile.data?.jwt || newAdmin == '') return
if (!profile.current?.jwt || newAdmin == '') return
adding = true
const r = await addAdmin(`${newAdmin}@${instance.data}`, true)