mirror of
https://github.com/gethomepage/homepage.git
synced 2025-12-05 21:47:48 +01:00
Enhancement: treat 'error' as custom api field when mapped (#5999)
This commit is contained in:
@@ -166,7 +166,11 @@ export default function Component({ service }) {
|
|||||||
refreshInterval: Math.max(1000, refreshInterval),
|
refreshInterval: Math.max(1000, refreshInterval),
|
||||||
});
|
});
|
||||||
|
|
||||||
if (customError) {
|
// if mappings includes an error field and the data contains an error field then show data even if there is an error
|
||||||
|
const mappingsIncludesError = Array.isArray(mappings) && mappings.find((mapping) => mapping.field === "error");
|
||||||
|
const errorIsData = customData && typeof customData === "object" && "error" in customData;
|
||||||
|
|
||||||
|
if (customError && !(mappingsIncludesError && errorIsData)) {
|
||||||
return <Container service={service} error={customError} />;
|
return <Container service={service} error={customError} />;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user