Skip to content

Commit 0fe6722

Browse files
committed
Fix not being able to comment or reply on blocked users as a moderator
Frontend side...
1 parent c91924b commit 0fe6722

File tree

3 files changed

+21
-3
lines changed

3 files changed

+21
-3
lines changed

frontend/app/components/site/list-comment.vue

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,13 @@ const canDelete = computed(() => {
188188
return user?.id === props.comment.user_id || store.hasPermission('manage-discussions', props.game) || props.canEditAll || props.canDeleteAll;
189189
});
190190
191-
const canReply = computed(() => props.canComment && !props.comment.user?.blocked_me);
191+
const canReply = computed(() => {
192+
if (!props.canComment) {
193+
return false;
194+
}
195+
196+
return props.canEditResource || !props.comment.user?.blocked_me;
197+
});
192198
193199
const classes = computed(() => {
194200
const focus = (focusComment.value && parseInt(focusComment.value) === props.comment.id) || (props.currentFocus && props.currentFocus.id === props.comment.id);

frontend/app/pages/mod/[mod]/index.vue

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,14 @@ const { mod } = defineProps<{
8080
const showReportModal = ref(false);
8181
const canEdit = computed(() => canEditMod(mod));
8282
const canDeleteComments = computed(() => canEdit.value && store.hasPermission('delete-own-mod-comments', mod.game));
83-
const canComment = computed(() => !mod.user?.blocked_me && !store.isBanned && (!mod.comments_disabled || canEdit.value));
83+
const canComment = computed(() => {
84+
if (canEdit.value) {
85+
return true;
86+
}
87+
88+
return !mod.user?.blocked_me && !store.isBanned && !mod.comments_disabled;
89+
});
90+
8491
const cannotCommentReason = computed(() => {
8592
if (mod.comments_disabled) {
8693
return t('comments_disabled');

frontend/app/pages/thread/[thread]/index.vue

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,10 +90,15 @@ const bannedCommenting = computed(() => {
9090
});
9191
9292
const canComment = computed(() => {
93+
if (canModerate.value) {
94+
return true;
95+
}
96+
9397
if (bannedCommenting.value || thread.user?.blocked_me) {
9498
return false;
9599
}
96-
return !thread.locked || canModerate.value || (thread.user_id === user?.id && !thread.locked_by_mod);
100+
101+
return !thread.locked || (thread.user_id === user?.id && !thread.locked_by_mod);
97102
});
98103
99104
const cannotCommentReason = computed(() => {

0 commit comments

Comments
 (0)