cindel 1.0.6 → 1.1.0

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/dist/client.js CHANGED
@@ -1630,7 +1630,11 @@ var FileLoader = class {
1630
1630
  script.src = url;
1631
1631
  script.setAttribute("data-file", path);
1632
1632
  return new Promise((resolve, reject) => {
1633
- script.onload = () => resolve(true);
1633
+ script.onload = () => {
1634
+ const previous = document.querySelector(`script[data-file="${path}"]:not([src="${url}"])`);
1635
+ if (previous) previous.remove();
1636
+ resolve(true);
1637
+ };
1634
1638
  script.onerror = () => reject(new Error(`Failed to load script: ${path}`));
1635
1639
  document.head.appendChild(script);
1636
1640
  });