diff options
| author | Terry Truong <terry06890@gmail.com> | 2022-05-01 17:32:03 +1000 |
|---|---|---|
| committer | Terry Truong <terry06890@gmail.com> | 2022-05-01 17:32:03 +1000 |
| commit | 56125407641ec8c633de7a5ee24cdd28c5221010 (patch) | |
| tree | 8c4562e9a9e9003d44b70657edd21a9335e82257 /src/components/SearchModal.vue | |
| parent | 6ffdf9bb99e14679019a82017bee2c1199c5313a (diff) | |
Reduce some unnecessary tolMap updates
Diffstat (limited to 'src/components/SearchModal.vue')
| -rw-r--r-- | src/components/SearchModal.vue | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/components/SearchModal.vue b/src/components/SearchModal.vue index 19a9942..a90c945 100644 --- a/src/components/SearchModal.vue +++ b/src/components/SearchModal.vue @@ -65,7 +65,11 @@ export default defineComponent({ fetch(url.toString()) .then(response => response.json()) .then(obj => { - Object.getOwnPropertyNames(obj).forEach(key => {this.tolMap.set(key, obj[key])}); + Object.getOwnPropertyNames(obj).forEach(key => { + if (!this.tolMap.has(key)){ + this.tolMap.set(key, obj[key]) + } + }); this.$emit('search-node', tolNodeName); }) .catch(error => { |
