Browse Source

Improve promise handling

master
Kenneth Bruen 2 years ago
parent
commit
5c95dec36d
Signed by: kbruen
GPG Key ID: C1980A470C3EE5B1
  1. 4
      view-train.js

4
view-train.js

@ -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

Loading…
Cancel
Save