mirror of
https://github.com/vector-im/hydrogen-web.git
synced 2024-11-20 03:25:52 +01:00
Use a copy of the value instead of a reference
This commit is contained in:
parent
4f9eca1a2c
commit
da763982ce
@ -47,13 +47,13 @@ export class FilteredMap<K, V> extends BaseObservableMap<K, V> {
|
||||
*/
|
||||
_reapplyFilter(silent = false): void {
|
||||
if (this._filter) {
|
||||
const oldIncluded = this._included;
|
||||
this._included = this._included || new Map();
|
||||
for (const [key, value] of this._source) {
|
||||
const isIncluded = this._filter(value, key);
|
||||
const oldIncluded = this._included.get(key);
|
||||
this._included.set(key, isIncluded);
|
||||
if (!silent) {
|
||||
const wasIncluded = oldIncluded ? oldIncluded.get(key) : true;
|
||||
const wasIncluded = oldIncluded ? oldIncluded : true;
|
||||
this._emitForUpdate(wasIncluded, isIncluded, key, value);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user