mirror of https://github.com/zulip/zulip.git
refactor: Rename MessageList.update_muting_and_rerender.
This is a prep commit for implementing mute users feature, which renames this function to be more specific. This function cannot be used as-is for user mutes, because for user-muted messages, we always want to rerender the message list, irrespective of what `excludes_muted_users` is. In muting_ui.js, we also remove an unnecessary conditional that is already handled by update_topic_muting_and_rerender itself.
This commit is contained in:
parent
f725711ff2
commit
3a9dfc02e6
|
@ -401,11 +401,11 @@ export function update_messages(events) {
|
||||||
// propagated edits to be updated (since the topic edits can have
|
// propagated edits to be updated (since the topic edits can have
|
||||||
// changed the correct grouping of messages).
|
// changed the correct grouping of messages).
|
||||||
if (topic_edited || stream_changed) {
|
if (topic_edited || stream_changed) {
|
||||||
message_lists.home.update_muting_and_rerender();
|
message_lists.home.update_topic_muting_and_rerender();
|
||||||
// However, we don't need to rerender message_list.narrowed if
|
// However, we don't need to rerender message_list.narrowed if
|
||||||
// we just changed the narrow earlier in this function.
|
// we just changed the narrow earlier in this function.
|
||||||
if (!changed_narrow && message_lists.current === message_list.narrowed) {
|
if (!changed_narrow && message_lists.current === message_list.narrowed) {
|
||||||
message_list.narrowed.update_muting_and_rerender();
|
message_list.narrowed.update_topic_muting_and_rerender();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// If the content of the message was edited, we do a special animation.
|
// If the content of the message was edited, we do a special animation.
|
||||||
|
|
|
@ -379,13 +379,12 @@ export class MessageList {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
update_muting_and_rerender() {
|
update_topic_muting_and_rerender() {
|
||||||
if (!this.excludes_muted_topics) {
|
if (this.excludes_muted_topics) {
|
||||||
return;
|
|
||||||
}
|
|
||||||
this.data.update_items_for_muting();
|
this.data.update_items_for_muting();
|
||||||
this.rerender();
|
this.rerender();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
all_messages() {
|
all_messages() {
|
||||||
return this.data.all_messages();
|
return this.data.all_messages();
|
||||||
|
|
|
@ -32,11 +32,9 @@ export function rerender_on_topic_update() {
|
||||||
|
|
||||||
stream_list.update_streams_sidebar();
|
stream_list.update_streams_sidebar();
|
||||||
recent_topics.complete_rerender();
|
recent_topics.complete_rerender();
|
||||||
if (message_lists.current.excludes_muted_topics) {
|
message_lists.current.update_topic_muting_and_rerender();
|
||||||
message_lists.current.update_muting_and_rerender();
|
|
||||||
}
|
|
||||||
if (message_lists.current !== message_lists.home) {
|
if (message_lists.current !== message_lists.home) {
|
||||||
message_lists.home.update_muting_and_rerender();
|
message_lists.home.update_topic_muting_and_rerender();
|
||||||
}
|
}
|
||||||
if (overlays.settings_open() && settings_muting.loaded) {
|
if (overlays.settings_open() && settings_muting.loaded) {
|
||||||
set_up_muted_topics_ui();
|
set_up_muted_topics_ui();
|
||||||
|
|
Loading…
Reference in New Issue