mirror of
https://github.com/MichMich/MagicMirror.git
synced 2025-07-04 14:47:20 +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
|
||||
- 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
|
||||
|
||||
## [2.1.1] - 2017-04-01
|
||||
|
@ -96,14 +96,14 @@ Module.register("compliments", {
|
||||
*/
|
||||
complimentArray: function() {
|
||||
var hour = moment().hour();
|
||||
var compliments = null;
|
||||
var compliments;
|
||||
|
||||
if (hour >= 3 && hour < 12) {
|
||||
compliments = this.config.compliments.morning;
|
||||
} else if (hour >= 12 && hour < 17) {
|
||||
compliments = this.config.compliments.afternoon;
|
||||
} else {
|
||||
compliments = this.config.compliments.evening;
|
||||
if (hour >= 3 && hour < 12 && this.config.compliments.hasOwnProperty("morning")) {
|
||||
compliments = this.config.compliments.morning.slice(0);
|
||||
} else if (hour >= 12 && hour < 17 && this.config.compliments.hasOwnProperty("afternoon")) {
|
||||
compliments = this.config.compliments.afternoon.slice(0);
|
||||
} else if(this.config.compliments.hasOwnProperty("evening")) {
|
||||
compliments = this.config.compliments.evening.slice(0);
|
||||
}
|
||||
|
||||
if (typeof compliments === "undefined") {
|
||||
@ -117,7 +117,6 @@ Module.register("compliments", {
|
||||
compliments.push.apply(compliments, this.config.compliments.anytime);
|
||||
|
||||
return compliments;
|
||||
|
||||
},
|
||||
|
||||
/* complimentFile(callback)
|
||||
|
Loading…
x
Reference in New Issue
Block a user