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:
@@ -12,7 +12,8 @@ export default function Component({ service }) {
|
||||
const { data: statsData, error: statsError } = useWidgetAPI(widget, "stat/sites");
|
||||
|
||||
if (statsError || statsData?.error) {
|
||||
return <Container error={t("widget.api_error")} />;
|
||||
const finalError = statsError ?? statsData.error;
|
||||
return <Container error={finalError} />;
|
||||
}
|
||||
|
||||
const defaultSite = statsData?.data?.find(s => s.name === "default");
|
||||
|
||||
Reference in New Issue
Block a user