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 38be5ea743.

[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.
This commit is contained in:
Sharif Naas 2020-06-02 23:10:25 -07:00 committed by Tim Abbott
parent b0a0ae215f
commit 60d7cdb447
1 changed files with 1 additions and 0 deletions

View File

@ -34,6 +34,7 @@ exports.fetch_and_render_message_history = function (message) {
item.new_topic = msg.topic; item.new_topic = msg.topic;
} else if (msg.prev_topic) { } else if (msg.prev_topic) {
item.posted_or_edited = "Topic edited by"; item.posted_or_edited = "Topic edited by";
item.show_date_row = !moment(timestamp).isSame(prev_timestamp, 'day');
item.topic_edited = true; item.topic_edited = true;
item.prev_topic = msg.prev_topic; item.prev_topic = msg.prev_topic;
item.new_topic = msg.topic; item.new_topic = msg.topic;