mirror of
https://github.com/DI0IK/homepage-plus.git
synced 2025-07-10 15:28:47 +00:00
Add detailed Error component for service widgets
This commit is contained in:
parent
7b7740563e
commit
21017e4716
37 changed files with 113 additions and 113 deletions
|
@ -9,12 +9,12 @@ export default function Component({ service }) {
|
|||
|
||||
const { widget } = service;
|
||||
|
||||
const { data } = useWidgetAPI(widget, "info");
|
||||
const { data, error } = useWidgetAPI(widget, "info");
|
||||
|
||||
if (!data) {
|
||||
return <Container error="widget.api_error" />;
|
||||
if (error || data?.error) {
|
||||
const finalError = error ?? data.error;
|
||||
return <Container error={finalError} />;
|
||||
}
|
||||
|
||||
const totalObserved = Object.keys(data).length;
|
||||
let diffsDetected = 0;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue