mirror of
https://github.com/gethomepage/homepage.git
synced 2025-12-07 09:35:54 -08:00
Simplify error catching
This commit is contained in:
@@ -11,9 +11,8 @@ export default function Component({ service }) {
|
||||
|
||||
const { data: torrentData, error: torrentError } = useWidgetAPI(widget, "torrents/info");
|
||||
|
||||
if (torrentError || torrentData?.error) {
|
||||
const finalError = torrentError ?? torrentData.error;
|
||||
return <Container error={finalError} />;
|
||||
if (torrentError) {
|
||||
return <Container error={torrentError} />;
|
||||
}
|
||||
|
||||
if (!torrentData) {
|
||||
|
||||
Reference in New Issue
Block a user