Fix #3469: Rejecting post shouldn't hide pending/flagged notices

Just reload the page entirely instead of trying to update it in place.
This commit is contained in:
evazion
2018-08-25 00:39:08 -05:00
parent f9a39c9fbe
commit 847237980b
2 changed files with 14 additions and 17 deletions

View File

@@ -1,13 +1,11 @@
<% if @approval.errors.any? %>
$(window).trigger("danbooru:error", "Error: " + <%= @approval.errors.full_messages.join("; ").to_json.html_safe %>);
<% else %>
$(window).trigger("danbooru:notice", "Post was approved");
$(window).trigger("danbooru:modqueue_increment_processed");
if ($("#c-posts #a-show").length) {
location.reload();
} else if ($("#c-moderator-post-queues").length) {
$("#c-moderator-post-queues #post-<%= @approval.post.id %>").hide();
$(window).trigger("danbooru:modqueue_increment_processed");
$(window).trigger("danbooru:notice", "Post was approved");
}
<% end %>
$("#c-posts #approve").hide();
$("#c-posts #disapprove").hide();
$("#c-posts #flag").show();
$("#pending-approval-notice, .notice-flagged, .notice-appealed").hide();
$("#c-moderator-post-queues #post-<%= @approval.post.id %>").hide();

View File

@@ -1,12 +1,11 @@
<% if @post_disapproval.errors.any? %>
$(window).trigger("danbooru:error", "Error: " + <%= @post_disapproval.errors.full_messages.join("; ").to_json.html_safe %>);
<% else %>
$(window).trigger("danbooru:notice", "Post was hidden");
$(window).trigger("danbooru:modqueue_increment_processed");
if ($("#c-posts #a-show").length) {
location.reload();
} else if ($("#c-moderator-post-queues").length) {
$("#c-moderator-post-queues #post-<%= @post_disapproval.post.id %>").hide();
$(window).trigger("danbooru:modqueue_increment_processed");
$(window).trigger("danbooru:notice", "Post was hidden");
}
<% end %>
$("#c-posts #approve").hide();
$("#c-posts #disapprove").hide();
$("#pending-approval-notice, .notice-flagged, .notice-appealed").hide();
$("#c-moderator-post-queues #post-<%= @post_disapproval.post.id %>").hide();