mirror of
https://github.com/cheeaun/phanpy.git
synced 2024-11-25 18:55:44 +03:00
Add simple loading state for switching instances
This commit is contained in:
parent
7cd78b8003
commit
3c7fc30444
1 changed files with 3 additions and 0 deletions
|
@ -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);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue