Fix regression with topic edits clearing narrows.

We had a recent regression that had kind of a funny symptom.
If somebody else edited a topic while you were in a topic
narrow, even if wasn't your topic, then your narrow would
mysteriously go empty upon the event coming to you.

The root cause of this is that when topic names change,
we often want to rerender a lot of the world due to muting.
But we want to suppress the re-render for topic narrows that
don't support the internal data structures.

This commit restores a simple guard condition that got lost
in a recent refactoring:

        see 3f736c9b06

From tabbott: This is not the correct ultimate place to end up,
because if a topic-edit moves messages in or out of a topic, the new
behavior is wrong.  But the bug this fixes is a lot worse than that,
and no super local change would do the right thing here.
This commit is contained in:
Steve Howell 2018-05-04 21:08:57 +00:00 committed by Tim Abbott
parent 43fa0aacbf
commit da0c01e4ba
1 changed files with 3 additions and 0 deletions

View File

@ -585,6 +585,9 @@ exports.MessageList.prototype = {
},
update_muting_and_rerender: function MessageList_update_muting_and_rerender() {
if (!this.muting_enabled) {
return;
}
this._items = this.unmuted_messages(this._all_items);
this.rerender();
},