Show remote compliments at boot instead of after one updateInterval

This commit is contained in:
henrysun18 2018-01-31 23:04:35 -05:00
parent 3b40f393d8
commit 6802d152da
2 changed files with 3 additions and 1 deletions

View File

@ -10,6 +10,7 @@ This project adheres to [Semantic Versioning](http://semver.org/).
- Add types for module. - Add types for module.
- Implement Danger.js to notify contributors when CHANGELOG.md is missing in PR. - 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) - 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 ### Fixed
- News article in fullscreen (iframe) is now shown in front of modules. - News article in fullscreen (iframe) is now shown in front of modules.

View File

@ -49,14 +49,15 @@ Module.register("compliments", {
this.lastComplimentIndex = -1; this.lastComplimentIndex = -1;
var self = this;
if (this.config.remoteFile != null) { if (this.config.remoteFile != null) {
this.complimentFile((response) => { this.complimentFile((response) => {
this.config.compliments = JSON.parse(response); this.config.compliments = JSON.parse(response);
self.updateDom();
}); });
} }
// Schedule update timer. // Schedule update timer.
var self = this;
setInterval(function() { setInterval(function() {
self.updateDom(self.config.fadeSpeed); self.updateDom(self.config.fadeSpeed);
}, this.config.updateInterval); }, this.config.updateInterval);