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:
1 parent
8c6ff77fac
commit
5651ad475d
83 files changed
+395
-469
No files matched your search
@@ -18,7 +18,7 @@ export async function load({ url, fetch }) {
|
||||
const filter: ReportFilter =
|
||||
(url.searchParams.get('filter') as ReportFilter) || 'all'
|
||||
|
||||
const jwt = get(profile)?.jwt
|
||||
const jwt = profile.data?.jwt
|
||||
|
||||
if (!jwt) return { type: type, page: page }
|
||||
|
||||
@@ -37,7 +37,7 @@ export async function load({ url, fetch }) {
|
||||
unresolved_only: type == 'unread',
|
||||
}
|
||||
|
||||
const admin = get(profile)?.user ? isAdmin(get(profile)!.user!) : false
|
||||
const admin = profile.data?.user ? isAdmin(profile!.user!) : false
|
||||
|
||||
const [posts, comments, messages] = await Promise.all([
|
||||
client.listPostReports({
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
|
||||
let resolving = $state(false)
|
||||
async function resolve() {
|
||||
if (!$profile?.jwt || !$profile.user) return
|
||||
if (!profile.data?.jwt || !profile.data.user) return
|
||||
resolving = true
|
||||
|
||||
try {
|
||||
|
||||
Reference in new issue
Block a user