Await plugin bootstrap methods

This commit is contained in:
Dan Stillman 2023-06-12 01:33:27 -04:00
parent 027060ba86
commit ffd6a988e1

View file

@ -143,6 +143,10 @@ Zotero.Plugins = new function () {
let result;
try {
result = func.call(scope, params, reason);
// If bootstrap method returns a promise, wait for it
if (result && result.then) {
await result;
}
}
catch (e) {
Zotero.logError(`Error running bootstrap method '${method}' on ${id}`);