From 56125407641ec8c633de7a5ee24cdd28c5221010 Mon Sep 17 00:00:00 2001 From: Terry Truong Date: Sun, 1 May 2022 17:32:03 +1000 Subject: Reduce some unnecessary tolMap updates --- src/components/SearchModal.vue | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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 => { -- cgit v1.2.3