mirror of
https://github.com/gethomepage/homepage.git
synced 2025-12-06 21:57:48 +01:00
Compare commits
1 Commits
7d78a99bc2
...
0395f21116
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0395f21116 |
@@ -14,8 +14,6 @@ export default function Error({ error }) {
|
||||
|
||||
if (typeof error === "string") {
|
||||
error = { message: error }; // eslint-disable-line no-param-reassign
|
||||
} else if (typeof error === "number") {
|
||||
error = { message: `Error ${error}` }; // eslint-disable-line no-param-reassign
|
||||
}
|
||||
|
||||
if (error?.data?.error) {
|
||||
|
||||
@@ -166,11 +166,7 @@ export default function Component({ service }) {
|
||||
refreshInterval: Math.max(1000, refreshInterval),
|
||||
});
|
||||
|
||||
// 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)) {
|
||||
if (customError) {
|
||||
return <Container service={service} error={customError} />;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user