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