mirror of
https://github.com/DI0IK/homepage-plus.git
synced 2025-07-13 08:20:34 +00:00
Simplify error catching
This commit is contained in:
parent
00163d2f44
commit
8a783ba9f6
41 changed files with 93 additions and 113 deletions
|
@ -9,8 +9,8 @@ export default function Component({ service }) {
|
|||
const { data: messagesData, error: messagesError } = useWidgetAPI(widget, "message");
|
||||
const { data: clientsData, error: clientsError } = useWidgetAPI(widget, "client");
|
||||
|
||||
if (appsError || appsData?.error || messagesError || messagesData?.error || clientsError || clientsData?.error) {
|
||||
const finalError = appsError ?? appsData?.error ?? messagesError ?? messagesData?.error ?? clientsError ?? clientsData?.error;
|
||||
if (appsError || messagesError || clientsError) {
|
||||
const finalError = appsError ?? messagesError ?? clientsError;
|
||||
return <Container error={finalError} />;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue