@dataloop-ai/components 0.20.67 → 0.20.68

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dataloop-ai/components",
3
- "version": "0.20.67",
3
+ "version": "0.20.68",
4
4
  "exports": {
5
5
  ".": "./index.ts",
6
6
  "./models": "./models.ts",
@@ -155,13 +155,15 @@ export default defineComponent({
155
155
 
156
156
  const loadSvg = () => {
157
157
  return new Promise<void>((resolve, reject) => {
158
+ const loadedIcon = icon.value
159
+
158
160
  const svgElement = new Image()
159
161
  svgElement.setAttribute('height', size.value)
160
162
  svgElement.setAttribute('width', size.value)
161
163
 
162
164
  svgElement.onload = () => {
163
165
  // In order to handle events and loading that occur mid unmounting.
164
- if (isDestroyed.value) {
166
+ if (isDestroyed.value || loadedIcon !== icon.value) {
165
167
  return
166
168
  }
167
169
  const container = svgIcon.value as HTMLDivElement