UX: indicate loading state when rechecking on the status page

This commit is contained in:
Pieter Vander Vennet 2024-07-29 03:27:34 +02:00
parent 2af6448156
commit 1f9b849bd3

View file

@ -19,6 +19,7 @@
const src = new UIEventSource(undefined) const src = new UIEventSource(undefined)
function check() { function check() {
src.setData(undefined)
const promise = raw ? Utils.download(url) : Utils.downloadJson(url) const promise = raw ? Utils.download(url) : Utils.downloadJson(url)
promise?.then((d) => src.setData({ success: d }))?.catch((err) => src.setData({ error: err })) promise?.then((d) => src.setData({ success: d }))?.catch((err) => src.setData({ error: err }))
} }