fix(backup/webui): hold Refresh spin ~450ms so instant refetches still pulse

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
librelad 2026-07-07 21:17:08 +01:00
parent ac07420ef1
commit 6bed124984

View File

@ -127,7 +127,10 @@ class BackupPage {
if (refreshBtn.classList.contains('is-refreshing')) return;
refreshBtn.classList.add('is-refreshing');
const done = () => refreshBtn.classList.remove('is-refreshing');
this.refreshAll().then(() => this.render()).then(done, done);
// Hold the spin for a beat even when the refetch is instant (local
// data) so the click always registers as a visible pulse.
const minSpin = new Promise((r) => setTimeout(r, 450));
Promise.all([this.refreshAll().then(() => this.render()), minSpin]).then(done, done);
return;
}