From 6670b050a1aa5597774a09ea69f64dee11ba4c3b Mon Sep 17 00:00:00 2001 From: "byte[]" Date: Sun, 6 Sep 2020 13:38:30 -0400 Subject: [PATCH] ensure comments are reindexed after image changes state --- lib/philomena/images.ex | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/philomena/images.ex b/lib/philomena/images.ex index dcdc6d87..183ff619 100644 --- a/lib/philomena/images.ex +++ b/lib/philomena/images.ex @@ -426,6 +426,7 @@ defmodule Philomena.Images do |> case do {:ok, result} -> reindex_image(duplicate_of_image) + Comments.reindex_comments(duplicate_of_image) {:ok, result} @@ -464,6 +465,7 @@ defmodule Philomena.Images do {:ok, %{image: image, tags: tags, reports: {_count, reports}} = result} -> Hider.hide_thumbnails(image, image.hidden_image_key) + Comments.reindex_comments(image) Reports.reindex_reports(reports) Tags.reindex_tags(tags) reindex_image(image) @@ -514,6 +516,7 @@ defmodule Philomena.Images do Hider.unhide_thumbnails(image, key) reindex_image(image) + Comments.reindex_comments(image) Tags.reindex_tags(tags) {:ok, image}