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

@@ -117,7 +117,7 @@
})
async function subscribe() {
if (!$profile?.jwt) return
if (!profile.data?.jwt) return
loading.subscribing = true
const subscribed =
community_view.subscribed == 'Subscribed' ||
@@ -226,7 +226,7 @@
<div
class="flex flex-row items-center gap-1 sticky bottom-0 drop-shadow-xl w-full"
>
{#if $profile?.jwt}
{#if profile.data?.jwt}
<Button
disabled={loading.subscribing}
loading={loading.subscribing}
@@ -250,7 +250,7 @@
: $t('cards.community.subscribe')}
</Button>
{/if}
{#if $profile?.user && amMod($profile.user, community_view.community)}
{#if profile.data?.user && amMod(profile.data.user, community_view.community)}
<Button
href="/c/{fullCommunityName(
community_view.community.name,
@@ -275,7 +275,7 @@
<Icon src={Newspaper} size="16" mini />
{$t('cards.community.modlog')}
</MenuButton>
{#if $profile?.jwt}
{#if profile.data?.jwt}
<MenuButton
color="danger-subtle"
size="lg"
@@ -289,7 +289,7 @@
? $t('cards.community.unblock')
: $t('cards.community.block')}
</MenuButton>
{#if $profile?.user}
{#if profile.data?.user}
<MenuButton
color="danger-subtle"
size="lg"
@@ -301,7 +301,7 @@
{$t('cards.community.blockInstance')}
</MenuButton>
{/if}
{#if $profile?.user && isAdmin($profile.user)}
{#if profile.data?.user && isAdmin(profile.data.user)}
<MenuButton
color="danger-subtle"
onclick={() =>