Merge pull request #2439 from fewieden/feature/add-error-to-callback

Added error to callback
This commit is contained in:
Michael Teeuw 2021-02-23 14:18:07 +01:00 committed by GitHub
commit ea6eebd809
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 3 deletions

View File

@ -19,6 +19,7 @@ _This release is scheduled to be released on 2021-04-01._
- Portuguese translations for "MODULE_CONFIG_CHANGED" and PRECIP. - Portuguese translations for "MODULE_CONFIG_CHANGED" and PRECIP.
- Respect parameter ColoredSymbolOnly also for custom events - Respect parameter ColoredSymbolOnly also for custom events
- Added a new parameter to hide time portion on relative times - Added a new parameter to hide time portion on relative times
- `module.show` has now the option for a callback on error.
- Added locale to sample config file - Added locale to sample config file
- Added support for self-signed certificates for the default calendar module (#466) - Added support for self-signed certificates for the default calendar module (#466)

View File

@ -295,6 +295,9 @@ var MM = (function () {
// Otherwise cancel show action. // Otherwise cancel show action.
if (module.lockStrings.length !== 0 && options.force !== true) { if (module.lockStrings.length !== 0 && options.force !== true) {
Log.log("Will not show " + module.name + ". LockStrings active: " + module.lockStrings.join(",")); Log.log("Will not show " + module.name + ". LockStrings active: " + module.lockStrings.join(","));
if (typeof options.onError === "function") {
options.onError(new Error("LOCK_STRING_ACTIVE"));
}
return; return;
} }

View File

@ -428,12 +428,11 @@ var Module = Class.extend({
callback = callback || function () {}; callback = callback || function () {};
options = options || {}; options = options || {};
var self = this;
MM.showModule( MM.showModule(
this, this,
speed, speed,
function () { () => {
self.resume(); this.resume();
callback(); callback();
}, },
options options