mirror of https://github.com/vector-im/riot-web
Tag Watcher don't create new filter if not needed, confuses references
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>pull/21833/head
parent
7996013cd5
commit
29defa3e57
|
@ -54,7 +54,11 @@ export class TagWatcher {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
newFilters.set(tag, new CommunityFilterCondition(group));
|
let filter = this.filters.get(tag);
|
||||||
|
if (!filter) {
|
||||||
|
filter = new CommunityFilterCondition(group);
|
||||||
|
}
|
||||||
|
newFilters.set(tag, filter);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Update the room list store's filters
|
// Update the room list store's filters
|
||||||
|
@ -73,10 +77,6 @@ export class TagWatcher {
|
||||||
if (!filter) continue;
|
if (!filter) continue;
|
||||||
|
|
||||||
this.store.removeFilter(filter);
|
this.store.removeFilter(filter);
|
||||||
}
|
|
||||||
|
|
||||||
// Destroy any and all old filter conditions to prevent resource leaks
|
|
||||||
for (const filter of this.filters.values()) {
|
|
||||||
filter.destroy();
|
filter.destroy();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue