From 23245790579ab2b11081f835821cbf173258db3d Mon Sep 17 00:00:00 2001 From: Felix Wiedenbach Date: Thu, 28 Jan 2021 07:33:02 +0100 Subject: [PATCH] add error to module show callback --- js/main.js | 5 +++-- js/module.js | 8 +++++--- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/js/main.js b/js/main.js index b7138d99..a27e8cca 100644 --- a/js/main.js +++ b/js/main.js @@ -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); } } }; diff --git a/js/module.js b/js/module.js index 14458f8a..bc6a925d 100644 --- a/js/module.js +++ b/js/module.js @@ -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 );