From 659c31f5cd80ec17ef88ba00fa95f27ff34dc2d2 Mon Sep 17 00:00:00 2001 From: evazion Date: Thu, 30 Apr 2020 20:18:44 -0500 Subject: [PATCH] Fix #3905: Unable to hide Mod Queue posts that were hidden in a separate tab. Don't show "You have already hidden this post" and "Post is already active" errors when disapproving a post. Just hide the post anyway regardless of whether we literally created a post disapproval record. --- app/views/post_disapprovals/create.js.erb | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/app/views/post_disapprovals/create.js.erb b/app/views/post_disapprovals/create.js.erb index 0e6f63ce1..ab2801a1b 100644 --- a/app/views/post_disapprovals/create.js.erb +++ b/app/views/post_disapprovals/create.js.erb @@ -1,10 +1,6 @@ -<% if @post_disapproval.errors.any? %> - Danbooru.error("Error: " + <%= @post_disapproval.errors.full_messages.join("; ").to_json.html_safe %>); -<% else %> - if ($("#c-posts #a-show").length) { - location.reload(); - } else if ($("#c-modqueue").length) { - $("#c-modqueue #post-<%= @post_disapproval.post.id %>").hide(); - Danbooru.notice("Post was hidden"); - } -<% end %> +if ($("#c-posts #a-show").length) { + location.reload(); +} else if ($("#c-modqueue").length) { + $("#c-modqueue #post-<%= @post_disapproval.post.id %>").hide(); + Danbooru.notice("Post was hidden"); +}