diff --git a/src/components/Actions/PostButtons.jsx b/src/components/Actions/PostButtons.jsx index da7ed34..3ea776e 100644 --- a/src/components/Actions/PostButtons.jsx +++ b/src/components/Actions/PostButtons.jsx @@ -233,6 +233,8 @@ export const PurgePostButton = ({ report, ...props }) => { const [confirmOpen, setConfirmOpen] = React.useState(false); const [purgeReason, setPurgeReason] = React.useState(""); + const { userRole } = getSiteData(); + const queryClient = useQueryClient(); const { data, callAction, isSuccess, isLoading, error } = useLemmyHttpAction("purgePost"); @@ -247,6 +249,8 @@ export const PurgePostButton = ({ report, ...props }) => { } }, [data]); + if (userRole != "admin") return null; + return ( <>