mirror of
https://github.com/MichMich/MagicMirror.git
synced 2025-06-29 20:49:54 +00:00
Merge pull request #1248 from E3V3A/patch-5
null check for notification removal
This commit is contained in:
commit
41242a2ae1
@ -12,6 +12,7 @@ This project adheres to [Semantic Versioning](http://semver.org/).
|
||||
|
||||
### Fixed
|
||||
- Fixed issue where wind chill could not be displayed in Fahrenheit. [#1247](https://github.com/MichMich/MagicMirror/issues/1247)
|
||||
- Fix issues where a module crashes when it tries to dismiss a non exsisting alert. [#1240](https://github.com/MichMich/MagicMirror/issues/1240)
|
||||
|
||||
### Updated
|
||||
- Updated italian translation
|
||||
|
@ -110,11 +110,13 @@ Module.register("alert",{
|
||||
},
|
||||
hide_alert: function(sender) {
|
||||
//Dismiss alert and remove from this.alerts
|
||||
this.alerts[sender.name].dismiss();
|
||||
this.alerts[sender.name] = null;
|
||||
//Remove overlay
|
||||
var overlay = document.getElementById("overlay");
|
||||
overlay.parentNode.removeChild(overlay);
|
||||
if (this.alerts[sender.name]) {
|
||||
this.alerts[sender.name].dismiss();
|
||||
this.alerts[sender.name] = null;
|
||||
//Remove overlay
|
||||
var overlay = document.getElementById("overlay");
|
||||
overlay.parentNode.removeChild(overlay);
|
||||
}
|
||||
},
|
||||
setPosition: function(pos) {
|
||||
//Add css to body depending on the set position for notifications
|
||||
|
Loading…
x
Reference in New Issue
Block a user