mirror of
https://github.com/vector-im/hydrogen-web.git
synced 2024-12-23 19:45:05 +01:00
Return array to prevent fetching again
Signed-off-by: RMidhunSuresh <rmidhunsuresh@gmail.com>
This commit is contained in:
parent
ea06d4f88e
commit
89e256e563
@ -35,8 +35,11 @@ export class Disambiguator {
|
|||||||
if (value) {
|
if (value) {
|
||||||
if (Array.isArray(value)) {
|
if (Array.isArray(value)) {
|
||||||
value.push(vm);
|
value.push(vm);
|
||||||
|
return value;
|
||||||
} else {
|
} else {
|
||||||
this._map.set(name, [value, vm]);
|
const array = [value, vm]
|
||||||
|
this._map.set(name, array);
|
||||||
|
return array;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
this._map.set(name, vm);
|
this._map.set(name, vm);
|
||||||
@ -46,11 +49,8 @@ export class Disambiguator {
|
|||||||
disambiguate(vm) {
|
disambiguate(vm) {
|
||||||
if (!vm.nameChanged) { return; }
|
if (!vm.nameChanged) { return; }
|
||||||
this._handlePreviousName(vm);
|
this._handlePreviousName(vm);
|
||||||
this._updateMap(vm);
|
const value = this._updateMap(vm);
|
||||||
const value = this._map.get(vm.name);
|
value?.forEach((vm) => vm.setDisambiguation(true));
|
||||||
if (Array.isArray(value)) {
|
|
||||||
value.forEach((vm) => vm.setDisambiguation(true));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user