Improve promise handling

This commit is contained in:
Kenneth Bruen 2022-09-20 00:16:45 +03:00
parent 2aa147060a
commit 5c95dec36d
Signed by: kbruen
GPG key ID: C1980A470C3EE5B1

View file

@ -316,9 +316,11 @@ function refresh() {
} }
return response.json() return response.json()
}).then(function (response) { }).then(function (response) {
if (!response) {
return
}
trainData = response trainData = response
onTrainData(response) onTrainData(response)
}).then(function () {
reschedule() reschedule()
}).catch(function (e) { }).catch(function (e) {
// Check in 1 second if network error // Check in 1 second if network error