Add detailed Error component for service widgets

This commit is contained in:
Michael Shamoon
2022-11-18 15:24:07 -08:00
parent 7b7740563e
commit 21017e4716
37 changed files with 113 additions and 113 deletions
+3 -2
View File
@@ -11,8 +11,9 @@ export default function Component({ service }) {
const { data: piholeData, error: piholeError } = useWidgetAPI(widget, "api.php");
if (piholeError) {
return <Container error={t("widget.api_error")} />;
if (piholeError || piholeData?.error) {
const finalError = piholeError ?? piholeData.error;
return <Container error={finalError} />;
}
if (!piholeData) {