This commit is contained in:
Astra 2018-04-22 01:27:32 -04:00
parent 967850d6a9
commit 881ae23ca8

View file

@ -35,20 +35,30 @@
fetch('https://endpwn.github.io/changelog.md?_=' + Date.now()).then(r => r.text()).then(l => { fetch('https://endpwn.github.io/changelog.md?_=' + Date.now()).then(r => r.text()).then(l => {
// we're racing discord's initialization procedures; try and hit a timing sweetspot // we're racing discord's initialization procedures; try and hit a timing sweetspot
setTimeout(() => { setTimeout(function () {
// get the changelog object try {
var log = $api.util.findFuncExports('changeLog');
var data = l.split(';;');
// set the date // get the changelog object
if (log.changeLog.date <= data[0]) var log = $api.util.findFuncExports('changeLog');
log.changeLog.date = data[0]; var data = l.split(';;');
// prepend to the changelog body // set the date
log.changeLog.body = data[1] + '\n\n' + log.changeLog.body; if (log.changeLog.date <= data[0])
log.changeLog.date = data[0];
}, 200); // prepend to the changelog body
log.changeLog.body = data[1] + '\n\n' + log.changeLog.body;
}
catch (e) {
// it failed, try again in 10 ms
setTimeout(callee, 10);
}
}, 100);
}); });