From 40c6ac663f95c40a154dc56598bdfe6e59f38703 Mon Sep 17 00:00:00 2001 From: whoswhip Date: Sat, 25 Apr 2026 02:22:26 -0400 Subject: [PATCH] fix: only show report button if logged in also switched to roles enum instead of directly using numbers in has role for paste comments --- SharpbinV3.Client/src/lib/components/PasteCommentItem.svelte | 4 ++-- SharpbinV3.Client/src/routes/user/[username]/+page.svelte | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/SharpbinV3.Client/src/lib/components/PasteCommentItem.svelte b/SharpbinV3.Client/src/lib/components/PasteCommentItem.svelte index 3dd7ac3..c81f0b1 100644 --- a/SharpbinV3.Client/src/lib/components/PasteCommentItem.svelte +++ b/SharpbinV3.Client/src/lib/components/PasteCommentItem.svelte @@ -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 @@ > - {#if hasRole($user.roles, 4) || hasRole($user.roles, 2)} + {#if hasRole($user.roles, roles.Moderator) || hasRole($user.roles, roles.Admin)}