Displaying plug icon when API fails to respond. Using window.apiDown to communicate to other hooks to stop fetching, the status interval will keep checking if the API is back up.

This commit is contained in:
Roland 2025-01-24 15:35:26 -07:00
parent e7415873a5
commit 01338e4d89
No known key found for this signature in database
GPG key ID: 1BA620CE6C9A4680
7 changed files with 76 additions and 21 deletions

View file

@ -178,7 +178,16 @@ export function NavBar() {
<Icon loading name='circle notch' size='large'/>
</Link>;
let apiDownIcon;
if (window.apiDown) {
apiDownIcon = <Popup
content='API is not responding'
trigger={<Icon name='plug'/>}
/>
}
const icons = <React.Fragment>
<NavIconWrapper>{apiDownIcon}</NavIconWrapper>
<NavIconWrapper>{processingIcon}</NavIconWrapper>
<NavIconWrapper>{powerIcon}</NavIconWrapper>
<NavIconWrapper>{warningIcon}</NavIconWrapper>