From 89e256e563be91160c76f9c8215e53ed43545c0b Mon Sep 17 00:00:00 2001 From: RMidhunSuresh Date: Fri, 2 Jul 2021 15:40:27 +0530 Subject: [PATCH] Return array to prevent fetching again Signed-off-by: RMidhunSuresh --- src/domain/session/rightpanel/disambiguator.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/domain/session/rightpanel/disambiguator.js b/src/domain/session/rightpanel/disambiguator.js index 8be92137..153fc6c1 100644 --- a/src/domain/session/rightpanel/disambiguator.js +++ b/src/domain/session/rightpanel/disambiguator.js @@ -35,8 +35,11 @@ export class Disambiguator { if (value) { if (Array.isArray(value)) { value.push(vm); + return value; } else { - this._map.set(name, [value, vm]); + const array = [value, vm] + this._map.set(name, array); + return array; } } else { this._map.set(name, vm); @@ -46,11 +49,8 @@ export class Disambiguator { disambiguate(vm) { if (!vm.nameChanged) { return; } this._handlePreviousName(vm); - this._updateMap(vm); - const value = this._map.get(vm.name); - if (Array.isArray(value)) { - value.forEach((vm) => vm.setDisambiguation(true)); - } + const value = this._updateMap(vm); + value?.forEach((vm) => vm.setDisambiguation(true)); } }