add error to module show callback

This commit is contained in:
Felix Wiedenbach 2021-01-28 07:33:02 +01:00
parent 3c357f057b
commit 2324579057
2 changed files with 8 additions and 5 deletions

View File

@ -295,6 +295,7 @@ var MM = (function () {
// Otherwise cancel show action.
if (module.lockStrings.length !== 0 && options.force !== true) {
Log.log("Will not show " + module.name + ". LockStrings active: " + module.lockStrings.join(","));
callback("Active lock strings");
return;
}
@ -321,13 +322,13 @@ var MM = (function () {
clearTimeout(module.showHideTimer);
module.showHideTimer = setTimeout(function () {
if (typeof callback === "function") {
callback();
callback(null);
}
}, speed);
} else {
// invoke callback
if (typeof callback === "function") {
callback();
callback(null);
}
}
};

View File

@ -432,9 +432,11 @@ var Module = Class.extend({
MM.showModule(
this,
speed,
function () {
self.resume();
callback();
function (error) {
if (!error) {
self.resume();
}
callback(error);
},
options
);