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