Merge pull request #2054 from MichMich/revert-pr-2021

Revert PR #2021
This commit is contained in:
Michael Teeuw 2020-06-24 12:36:28 +02:00 committed by GitHub
commit c4bc3e2687
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 1 additions and 15 deletions

View File

@ -11,7 +11,6 @@ _This release is scheduled to be released on 2020-07-01._
### Added
- Compliments Module - Add Advice API (https://api.adviceslip.com/) Option
- Added option to config the level of logging
- Added prettier for an even cleaner codebase
- Hide Sunrise/Sunset in Weather module

View File

@ -22,8 +22,7 @@ Module.register("compliments", {
afternoonStartTime: 12,
afternoonEndTime: 17,
random: true,
mockDate: null,
advice: false
mockDate: null
},
lastIndexUsed: -1,
// Set currentweather from module
@ -46,18 +45,6 @@ Module.register("compliments", {
self.config.compliments = JSON.parse(response);
self.updateDom();
});
} else if (this.config.advice) {
var xobj = new XMLHttpRequest();
xobj.overrideMimeType("application/json");
xobj.open("GET", "https://api.adviceslip.com/advice", true);
xobj.onreadystatechange = function () {
if (xobj.readyState === 4 && xobj.status === 200) {
const adviceResp = JSON.parse(xobj.responseText);
self.config.compliments = adviceResp.slip.advice;
self.updateDom();
}
};
xobj.send(null);
}
// Schedule update timer.