mirror of
https://github.com/whoswhip/Sharpbin.git
synced 2026-12-06 02:48:43 +00:00
fix: only show report button if logged in
also switched to roles enum instead of directly using numbers in has role for paste comments
This commit is contained in:
@@ -8,7 +8,7 @@
|
||||
import { ThumbsUp, ThumbsDown, Trash2, Shredder } from '@lucide/svelte';
|
||||
import { resolve } from '$app/paths';
|
||||
import RichTextEditor from './RichTextEditor.svelte';
|
||||
import { hasRole } from '$lib/utils/auth';
|
||||
import { hasRole, roles } from '$lib/utils/auth';
|
||||
|
||||
interface Props {
|
||||
node: CommentTreeNode;
|
||||
@@ -221,7 +221,7 @@
|
||||
>
|
||||
<Trash2 class="inline h-3.5 w-3.5" />
|
||||
</button>
|
||||
{#if hasRole($user.roles, 4) || hasRole($user.roles, 2)}
|
||||
{#if hasRole($user.roles, roles.Moderator) || hasRole($user.roles, roles.Admin)}
|
||||
<button
|
||||
type="button"
|
||||
class="h-7 rounded border border-neutral-700 px-2 py-1 text-xs text-neutral-300 hover:bg-neutral-800 hover:text-neutral-100 active:bg-neutral-700"
|
||||
|
||||
@@ -614,7 +614,7 @@
|
||||
</div>
|
||||
{/if}
|
||||
</div>
|
||||
{#if !isOwner && !$user?.isBanned}
|
||||
{#if !isOwner && !$user?.isBanned && $user}
|
||||
<!-- svelte-ignore a11y_click_events_have_key_events -->
|
||||
<!-- svelte-ignore a11y_no_static_element_interactions -->
|
||||
<div
|
||||
|
||||
Reference in New Issue
Block a user