mirror of
https://gitlab.com/MrFry/moodle-test-userscript
synced 2025-04-01 20:22:48 +02:00
Always requesting data from server if last message status was not success
This commit is contained in:
parent
6504ec2b0b
commit
22275e3943
1 changed files with 3 additions and 2 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue