mirror of
https://github.com/MichMich/MagicMirror.git
synced 2025-07-04 22:58:03 +00:00
Merge pull request #867 from fewieden/bugfix-compliment-duplicates
bugfix for duplicated compliments
This commit is contained in:
commit
a6485b61a4
@ -24,6 +24,7 @@ This project adheres to [Semantic Versioning](http://semver.org/).
|
|||||||
|
|
||||||
### Fixed
|
### Fixed
|
||||||
- Fix instruction in README for using automatically installer script.
|
- Fix instruction in README for using automatically installer script.
|
||||||
|
- Bug of duplicated compliments as described in [here](https://forum.magicmirror.builders/topic/2381/compliments-module-stops-cycling-compliments).
|
||||||
- Fix double message about port when server is starting
|
- Fix double message about port when server is starting
|
||||||
|
|
||||||
## [2.1.1] - 2017-04-01
|
## [2.1.1] - 2017-04-01
|
||||||
|
@ -96,14 +96,14 @@ Module.register("compliments", {
|
|||||||
*/
|
*/
|
||||||
complimentArray: function() {
|
complimentArray: function() {
|
||||||
var hour = moment().hour();
|
var hour = moment().hour();
|
||||||
var compliments = null;
|
var compliments;
|
||||||
|
|
||||||
if (hour >= 3 && hour < 12) {
|
if (hour >= 3 && hour < 12 && this.config.compliments.hasOwnProperty("morning")) {
|
||||||
compliments = this.config.compliments.morning;
|
compliments = this.config.compliments.morning.slice(0);
|
||||||
} else if (hour >= 12 && hour < 17) {
|
} else if (hour >= 12 && hour < 17 && this.config.compliments.hasOwnProperty("afternoon")) {
|
||||||
compliments = this.config.compliments.afternoon;
|
compliments = this.config.compliments.afternoon.slice(0);
|
||||||
} else {
|
} else if(this.config.compliments.hasOwnProperty("evening")) {
|
||||||
compliments = this.config.compliments.evening;
|
compliments = this.config.compliments.evening.slice(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (typeof compliments === "undefined") {
|
if (typeof compliments === "undefined") {
|
||||||
@ -117,7 +117,6 @@ Module.register("compliments", {
|
|||||||
compliments.push.apply(compliments, this.config.compliments.anytime);
|
compliments.push.apply(compliments, this.config.compliments.anytime);
|
||||||
|
|
||||||
return compliments;
|
return compliments;
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
/* complimentFile(callback)
|
/* complimentFile(callback)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user