Keep the waiting status visible across refresh retries

Pass the waiting message through the retry instead of resetting it to
the step message on each re-fetch.
This commit is contained in:
raucao committed 2026-11-18 21:49:46 +04:00
1 parent c4c9a61297
commit 31dfbc4b08
1 file changed
+2 -2
@@ -9,6 +9,7 @@ const MESSAGES = {
profile: "Fetching your profile…",
blossom: "Fetching your media server list…"
}
const WAITING_MESSAGE = "Waiting for your changes to appear…"
export default class extends Controller {
static targets = [ "status", "loading", "content", "retry" ]
@@ -61,9 +62,8 @@ export default class extends Controller {
if (this.awaitingUpdate(step, data, options)) {
const attempts = (options.attempts || 0) + 1
this.statusTarget.textContent = "Waiting for your changes to appear…"
setTimeout(
() => this.runStep(step, { ...options, message: null, attempts }),
() => this.runStep(step, { ...options, message: WAITING_MESSAGE, attempts }),
REFRESH_DELAY
)
return