mirror of
https://github.com/gethomepage/homepage.git
synced 2025-12-07 09:35:54 -08:00
Add detailed Error component for service widgets
This commit is contained in:
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user