mirror of
https://github.com/DI0IK/homepage-plus.git
synced 2025-07-19 19:19:50 +00:00
Simplify error catching
This commit is contained in:
parent
00163d2f44
commit
8a783ba9f6
41 changed files with 93 additions and 113 deletions
|
@ -41,8 +41,8 @@ export default function Component({ service }) {
|
|||
const { data: alertData, error: alertError } = useWidgetAPI(widget, "alerts");
|
||||
const { data: statusData, error: statusError } = useWidgetAPI(widget, "status");
|
||||
|
||||
if (alertError || alertData?.error || statusError || statusData?.error) {
|
||||
const finalError = alertError ?? alertData?.error ?? statusError ?? statusData?.error;
|
||||
if (alertError || statusError) {
|
||||
const finalError = alertError ?? statusError;
|
||||
return <Container error={finalError} />;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue