Fix: Respect hideErrors for Calendar widget (#2259)

This commit is contained in:
shamoon 2023-10-29 20:14:06 -07:00 committed by GitHub
parent 654f16dbb5
commit 5512d05f00
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 12 additions and 9 deletions

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: readarrData, error: readarrError } = useWidgetAPI(config, "calendar", {
...params,
@ -37,5 +37,5 @@ export default function Integration({ config, params }) {
}, [readarrData, readarrError, config, setEvents]);
const error = readarrError ?? readarrData?.error;
return error && <Error error={{ message: `${config.type}: ${error.message ?? error}` }} />;
return error && !hideErrors && <Error error={{ message: `${config.type}: ${error.message ?? error}` }} />;
}