From 60d7cdb447c92bddc6b46d2e804313f0454450dc Mon Sep 17 00:00:00 2001 From: Sharif Naas Date: Tue, 2 Jun 2020 23:10:25 -0700 Subject: [PATCH] edit_history: Fix topic-only edits never showing a date row. Previously it was impossible for a topic-only edit to show a date row in any circumstance; the code that handles topic-only edits didn't even attempt to set show_date_row, the flag that determines whether a date row should be rendered. Now a topic-only edit will show a date row in the same circumstances as any other edit[1]. This bug has existed since March 2019, when rendering of topic-only edits was first added in 38be5ea74394d2fd8586038de6ac447b4bbfbf67. [1] Currently, "the same circumstances as any other edit" means there'll be a date row on the original message, and then on every edit not made on the same date as the original message, even if it was't the first edit on the date it was made. This is a bug that will be fixed in a following commit. This commit is being made first since it's fixing a lack-of-information bug, whereas the other bug is a somewhat less important repeating-information bug. --- static/js/message_edit_history.js | 1 + 1 file changed, 1 insertion(+) diff --git a/static/js/message_edit_history.js b/static/js/message_edit_history.js index 99860336de..9342de9276 100644 --- a/static/js/message_edit_history.js +++ b/static/js/message_edit_history.js @@ -34,6 +34,7 @@ exports.fetch_and_render_message_history = function (message) { item.new_topic = msg.topic; } else if (msg.prev_topic) { item.posted_or_edited = "Topic edited by"; + item.show_date_row = !moment(timestamp).isSame(prev_timestamp, 'day'); item.topic_edited = true; item.prev_topic = msg.prev_topic; item.new_topic = msg.topic;