From 22275e394369c365a57e170210eea80f85c3724e Mon Sep 17 00:00:00 2001 From: MrFry Date: Thu, 9 Apr 2020 17:14:35 +0200 Subject: [PATCH] Always requesting data from server if last message status was not success --- stable.user.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/stable.user.js b/stable.user.js index ccf0aa5..db602b0 100755 --- a/stable.user.js +++ b/stable.user.js @@ -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)