Fix guard against concurrently loading of assets.
This commit is contained in:
parent
c5401a0927
commit
d613f3f559
|
@ -36,7 +36,8 @@ export default function loadScript(url, opts) {
|
|||
opts = opts || {};
|
||||
|
||||
$('script').each((i, tag) => {
|
||||
_loaded[tag.getAttribute('src')] = true;
|
||||
const src = tag.getAttribute('src');
|
||||
if (src) _loaded[tag.getAttribute('src')] = true;
|
||||
});
|
||||
|
||||
|
||||
|
@ -57,12 +58,12 @@ export default function loadScript(url, opts) {
|
|||
});
|
||||
|
||||
const cb = function(data) {
|
||||
_loaded[url] = true;
|
||||
if (opts && opts.css) {
|
||||
$("head").append("<style>" + data + "</style>");
|
||||
}
|
||||
done();
|
||||
resolve();
|
||||
_loaded[url] = true;
|
||||
};
|
||||
|
||||
let cdnUrl = url;
|
||||
|
|
Loading…
Reference in New Issue