From 6802d152da8a92859cb1be9948221b2283945da6 Mon Sep 17 00:00:00 2001 From: henrysun18 Date: Wed, 31 Jan 2018 23:04:35 -0500 Subject: [PATCH] Show remote compliments at boot instead of after one updateInterval --- CHANGELOG.md | 1 + modules/default/compliments/compliments.js | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 10910f53..d5ae61e8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ This project adheres to [Semantic Versioning](http://semver.org/). - Add types for module. - Implement Danger.js to notify contributors when CHANGELOG.md is missing in PR. - Allow to scroll in full page article view of default newsfeed module with gesture events from [MMM-Gestures](https://github.com/thobach/MMM-Gestures) +- Changed 'compliments.js' - update DOM if remote compliments are loaded instead of waiting one updateInterval to show custom compliments ### Fixed - News article in fullscreen (iframe) is now shown in front of modules. diff --git a/modules/default/compliments/compliments.js b/modules/default/compliments/compliments.js index a0af458d..f67183ad 100644 --- a/modules/default/compliments/compliments.js +++ b/modules/default/compliments/compliments.js @@ -49,14 +49,15 @@ Module.register("compliments", { this.lastComplimentIndex = -1; + var self = this; if (this.config.remoteFile != null) { this.complimentFile((response) => { this.config.compliments = JSON.parse(response); + self.updateDom(); }); } // Schedule update timer. - var self = this; setInterval(function() { self.updateDom(self.config.fadeSpeed); }, this.config.updateInterval);