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
@@ -33,9 +33,9 @@
|
||||
<ShieldIcon filled width={14} />
|
||||
</Button>
|
||||
{/snippet}
|
||||
{#if ($profile?.user && amMod($profile.user, item.community)) || ($profile?.user && isAdmin($profile.user))}
|
||||
{#if (profile.data?.user && amMod(profile.data.user, item.community)) || (profile.data?.user && isAdmin(profile.data.user))}
|
||||
<MenuDivider>
|
||||
{#if !item.community.local && !amMod($profile.user, item.community)}
|
||||
{#if !item.community.local && !amMod(profile.data.user, item.community)}
|
||||
{$t('moderation.labelInstanceOnly')}
|
||||
{:else}
|
||||
{$t('moderation.label')}
|
||||
@@ -53,7 +53,7 @@
|
||||
{item.post.removed ? $t('moderation.restore') : $t('moderation.remove')}
|
||||
{/if}
|
||||
</MenuButton>
|
||||
{#if $profile?.user && $profile.user?.local_user_view.person.id != item.creator.id}
|
||||
{#if profile.data?.user && profile.data.user?.local_user_view.person.id != item.creator.id}
|
||||
<!--Comment made by someone else-->
|
||||
<MenuButton
|
||||
color="danger-subtle"
|
||||
@@ -72,12 +72,12 @@
|
||||
<MenuButton
|
||||
color="success-subtle"
|
||||
onclick={async () => {
|
||||
if (!$profile.jwt) return
|
||||
if (!profile.data.jwt) return
|
||||
item.comment = (
|
||||
await feature(
|
||||
!item.comment.distinguished,
|
||||
item.comment,
|
||||
$profile.jwt,
|
||||
profile.data.jwt,
|
||||
)
|
||||
).comment_view.comment
|
||||
}}
|
||||
@@ -92,7 +92,7 @@
|
||||
{/if}
|
||||
{/if}
|
||||
|
||||
{#if $profile?.user && isAdmin($profile.user)}
|
||||
{#if profile.data?.user && isAdmin(profile.data.user)}
|
||||
<MenuDivider>{$t('admin.label')}</MenuDivider>
|
||||
<MenuButton color="danger-subtle" onclick={() => remove(item, true)}>
|
||||
{#snippet prefix()}
|
||||
|
||||
Reference in new issue
Block a user