mirror of
https://github.com/zulip/zulip.git
synced 2025-11-03 13:33:24 +00:00
message_list: Don't store excludes_muted_topics twice.
There is no need to store this field (and make sure that it's the same in both the message_list and message_list_data objects) on message_list objects, because we can anyways access it easily with `message_list.data.excludes_muted_topics`, and storing it just on the data object seems more intuitive. This also simplifies the constructor for the `MessageList` class.
This commit is contained in:
committed by
Tim Abbott
parent
15e3420ee4
commit
9d8bcce4c1
@@ -19,14 +19,12 @@ export function set_narrowed(value) {
|
||||
export class MessageList {
|
||||
constructor(opts) {
|
||||
if (opts.data) {
|
||||
this.excludes_muted_topics = opts.data.excludes_muted_topics;
|
||||
this.data = opts.data;
|
||||
} else {
|
||||
const filter = opts.filter;
|
||||
|
||||
this.excludes_muted_topics = opts.excludes_muted_topics;
|
||||
this.data = new MessageListData({
|
||||
excludes_muted_topics: this.excludes_muted_topics,
|
||||
excludes_muted_topics: opts.excludes_muted_topics,
|
||||
filter,
|
||||
});
|
||||
}
|
||||
@@ -386,8 +384,8 @@ export class MessageList {
|
||||
}
|
||||
|
||||
update_topic_muting_and_rerender() {
|
||||
if (this.excludes_muted_topics) {
|
||||
this.data.update_items_for_muting();
|
||||
this.data.update_items_for_muting();
|
||||
if (this.data.excludes_muted_topics) {
|
||||
this.rerender();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user