mirror of
https://github.com/zulip/zulip.git
synced 2025-10-23 04:52:12 +00:00
message_list: Clean up API for rerender_after_muting_changes.
This was only called from two places in one function, and we can just check muting_enabled in the caller. This refactor is important, because we might need to update muting after other changes (specifically, message editing to move a topic to be muted/non-muted).
This commit is contained in:
@@ -564,11 +564,7 @@ exports.MessageList.prototype = {
|
||||
}
|
||||
},
|
||||
|
||||
rerender_after_muting_changes: function MessageList_rerender_after_muting_changes() {
|
||||
if (!this.muting_enabled) {
|
||||
return;
|
||||
}
|
||||
|
||||
update_muting_and_rerender: function MessageList_update_muting_and_rerender() {
|
||||
this._items = this.unmuted_messages(this._all_items);
|
||||
this.rerender();
|
||||
},
|
||||
|
@@ -15,9 +15,11 @@ exports.rerender = function () {
|
||||
// re-doing a mute or unmute is a pretty recoverable thing.
|
||||
|
||||
stream_list.update_streams_sidebar();
|
||||
current_msg_list.rerender_after_muting_changes();
|
||||
if (current_msg_list.muting_enabled) {
|
||||
current_msg_list.update_muting_and_rerender();
|
||||
}
|
||||
if (current_msg_list !== home_msg_list) {
|
||||
home_msg_list.rerender_after_muting_changes();
|
||||
home_msg_list.update_muting_and_rerender();
|
||||
}
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user