Fix: Respect hideErrors for Calendar widget (#2259)

This commit is contained in:
shamoon authored and GitHub committed 2023-10-29 20:14:06 -07:00
1 parent 654f16dbb5
commit 5512d05f00
5 files changed
+12 -9

No files matched your search

+2 -2
View File
@@ -5,7 +5,7 @@ import useWidgetAPI from "../../../utils/proxy/use-widget-api";
import { EventContext } from "../../../utils/contexts/calendar";
import Error from "../../../components/services/widget/error";
export default function Integration({ config, params }) {
export default function Integration({ config, params, hideErrors = false }) {
const { setEvents } = useContext(EventContext);
const { data: lidarrData, error: lidarrError } = useWidgetAPI(config, "calendar", {
...params,
@@ -36,5 +36,5 @@ export default function Integration({ config, params }) {
}, [lidarrData, lidarrError, config, setEvents]);
const error = lidarrError ?? lidarrData?.error;
return error && <Error error={{ message: `${config.type}: ${error.message ?? error}` }} />;
return error && !hideErrors && <Error error={{ message: `${config.type}: ${error.message ?? error}` }} />;
}