Always requesting data from server if last message status was not success

This commit is contained in:
MrFry 2020-04-09 17:14:35 +02:00
parent 6504ec2b0b
commit 22275e3943

View file

@ -1708,7 +1708,8 @@
setVal('lastInfoCheckTime', now)
}
if (now > lastCheck + (infoExpireTime * 1000)) {
const lastInfo = JSON.parse(getVal('lastInfo'))
if (lastInfo.result !== 'success' || now > lastCheck + (infoExpireTime * 1000)) {
return new Promise((resolve, reject) => {
const url = apiAdress +
'infos?version=true&motd=true&subjinfo=true&cversion=' +
@ -1744,7 +1745,7 @@
} else {
return new Promise((resolve, reject) => {
try {
resolve(JSON.parse(getVal('lastInfo')))
resolve(lastInfo)
} catch (e) {
Log('Errro paring JSON in GetXHRInfos, when using old data!')
Log(e)