feat: use state based auth instead of store based (#488)

* misc: switch to state for auth

* fix: class based auth not working
This commit is contained in:
Xylight authored and GitHub committed 2025-02-08 13:49:09 -08:00
1 parent 8c6ff77fac
commit 5651ad475d
83 files changed
+395 -469

No files matched your search

+1 -1
View File
@@ -35,7 +35,7 @@
let markingAsRead = $state(false)
async function markAllAsRead() {
if (!$profile?.user) {
if (!profile.data?.user) {
goto('/login')
return
}
+1 -1
View File
@@ -11,7 +11,7 @@ import { get } from 'svelte/store'
type InboxFeedType = 'replies' | 'mentions' | 'messages' | 'all'
export async function load({ url, fetch }) {
const auth = get(profile)
const auth = profile
if (!auth?.jwt) return
const type: InboxFeedType =
+2 -2
View File
@@ -39,7 +39,7 @@
let loading = $state(false)
async function markAsRead(isRead: boolean) {
if (!$profile?.jwt) return
if (!profile.data?.jwt) return
loading = true
@@ -67,7 +67,7 @@
}
item.read = isRead
if ($profile.user) $notifications.inbox += isRead ? -1 : 1
if (profile.data.user) $notifications.inbox += isRead ? -1 : 1
loading = false
}
+1 -1
View File
@@ -64,7 +64,7 @@
{:then data}
{@const conversations = data.private_messages}
{@const previews = conversationPreviews(conversations).filter(
(c) => c.user.id != $profile?.user?.local_user_view.person.id,
(c) => c.user.id != profile.data?.user?.local_user_view.person.id,
)}
<ul