Add simple loading state for switching instances

This commit is contained in:
Lim Chee Aun 2023-02-28 22:44:10 +08:00
parent 7cd78b8003
commit 3c7fc30444

View file

@ -646,7 +646,9 @@ function StatusPage() {
</p> </p>
<button <button
type="button" type="button"
disabled={uiState === 'loading'}
onClick={() => { onClick={() => {
setUIState('loading');
(async () => { (async () => {
try { try {
const results = const results =
@ -667,6 +669,7 @@ function StatusPage() {
throw new Error('No results'); throw new Error('No results');
} }
} catch (e) { } catch (e) {
setUIState('default');
alert('Error: ' + e); alert('Error: ' + e);
console.error(e); console.error(e);
} }