mirror of
https://github.com/DI0IK/homepage-plus.git
synced 2025-07-09 14:58:47 +00:00
Simplify error catching
This commit is contained in:
parent
00163d2f44
commit
8a783ba9f6
41 changed files with 93 additions and 113 deletions
|
@ -13,8 +13,8 @@ export default function Component({ service }) {
|
|||
const { data: wantedData, error: wantedError } = useWidgetAPI(widget, "wanted/missing");
|
||||
const { data: queueData, error: queueError } = useWidgetAPI(widget, "queue/status");
|
||||
|
||||
if (booksError || booksData?.error || wantedError || wantedData?.error || queueError || queueData?.error) {
|
||||
const finalError = booksError ?? booksData?.error ?? wantedError ?? wantedData?.error ?? queueError ?? queueData?.error;
|
||||
if (booksError || wantedError || queueError) {
|
||||
const finalError = booksError ?? wantedError ?? queueError;
|
||||
return <Container error={finalError} />;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue