mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-01-18 11:58:24 +01:00
Avoid infinite loop if loading JS file fails
This commit is contained in:
parent
69aaa14037
commit
5a209a00f0
@ -164,6 +164,7 @@ egw.extend('files', egw.MODULE_WND_LOCAL, function(_app, _wnd)
|
|||||||
promise = import(_prefix ? _prefix+src : src)
|
promise = import(_prefix ? _prefix+src : src)
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
console.error(src+": "+err.message);
|
console.error(src+": "+err.message);
|
||||||
|
return Promise.reject(err.message);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -172,6 +173,7 @@ egw.extend('files', egw.MODULE_WND_LOCAL, function(_app, _wnd)
|
|||||||
import(_prefix ? _prefix+src : src)
|
import(_prefix ? _prefix+src : src)
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
console.error(src+": "+err.message);
|
console.error(src+": "+err.message);
|
||||||
|
return Promise.reject(err.message);
|
||||||
})
|
})
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
@ -538,7 +538,8 @@ egw.extend('json', egw.MODULE_WND_LOCAL, function(_app, _wnd)
|
|||||||
else if (i == 1 && parts[0] == 'app' && typeof app.classes[parts[1]] === 'undefined')
|
else if (i == 1 && parts[0] == 'app' && typeof app.classes[parts[1]] === 'undefined')
|
||||||
{
|
{
|
||||||
return this.includeJS('/'+parts[1]+'/js/app.js', undefined, undefined, this.webserverUrl)
|
return this.includeJS('/'+parts[1]+'/js/app.js', undefined, undefined, this.webserverUrl)
|
||||||
.then(() => this.applyFunc(_func, args, _context));
|
.then(() => this.applyFunc(_func, args, _context),
|
||||||
|
(err) => {console.error("Failure loading /"+parts[1]+'/js/app.js' + " (" + err + ")\nAborting.")});
|
||||||
}
|
}
|
||||||
// check if we need a not yet instantiated app.js object --> instantiate it now
|
// check if we need a not yet instantiated app.js object --> instantiate it now
|
||||||
else if (i == 1 && parts[0] == 'app' && typeof app.classes[parts[1]] === 'function')
|
else if (i == 1 && parts[0] == 'app' && typeof app.classes[parts[1]] === 'function')
|
||||||
|
Loading…
Reference in New Issue
Block a user