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>
|
||||
<button
|
||||
type="button"
|
||||
disabled={uiState === 'loading'}
|
||||
onClick={() => {
|
||||
setUIState('loading');
|
||||
(async () => {
|
||||
try {
|
||||
const results =
|
||||
|
@ -667,6 +669,7 @@ function StatusPage() {
|
|||
throw new Error('No results');
|
||||
}
|
||||
} catch (e) {
|
||||
setUIState('default');
|
||||
alert('Error: ' + e);
|
||||
console.error(e);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue