From 825ece98780d26571aac2288eaba2a4f7d1bb15c Mon Sep 17 00:00:00 2001 From: XiNGRZ Date: Sat, 6 Apr 2024 21:05:34 +0800 Subject: [PATCH] Check before requesting to resolve icons Though we had checked if the icon is fetching or failed in `resolve`, this promised function gets called on each prop updates, creating many many unneccessary Promise instances. --- src/components/BSMap/BSIcon.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/BSMap/BSIcon.vue b/src/components/BSMap/BSIcon.vue index a96abb2..bc812e7 100644 --- a/src/components/BSMap/BSIcon.vue +++ b/src/components/BSMap/BSIcon.vue @@ -40,7 +40,7 @@ const parts = computed(() => { }); watch(parts, ({ type, src }) => { - if (type == 'icon') { + if (type == 'icon' && typeof iconStore.icons[src] == 'undefined') { iconStore.resolve(src); } }, { immediate: true });