Skip to content

Commit

Permalink
Check before requesting to resolve icons
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
xingrz committed Apr 6, 2024
1 parent 6e2d9bb commit 825ece9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/components/BSMap/BSIcon.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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 });
Expand Down

0 comments on commit 825ece9

Please sign in to comment.