aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTerry Truong <terry06890@gmail.com>2022-05-01 17:32:03 +1000
committerTerry Truong <terry06890@gmail.com>2022-05-01 17:32:03 +1000
commit56125407641ec8c633de7a5ee24cdd28c5221010 (patch)
tree8c4562e9a9e9003d44b70657edd21a9335e82257
parent6ffdf9bb99e14679019a82017bee2c1199c5313a (diff)
Reduce some unnecessary tolMap updates
-rw-r--r--src/components/SearchModal.vue6
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 => {