Simplify error catching

This commit is contained in:
Michael Shamoon 2022-11-07 09:24:15 -08:00
parent 00163d2f44
commit 8a783ba9f6
41 changed files with 93 additions and 113 deletions

View file

@ -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) {