🏗 Added error check state
This commit is contained in:
@@ -47,9 +47,14 @@ export const QbittorrentConnectionForm = (): ReactElement => {
|
|||||||
}),
|
}),
|
||||||
});
|
});
|
||||||
|
|
||||||
|
if (isError)
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
{!isLoading ? (
|
<pre>Something went wrong connecting to qBittorrent.</pre>
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
if (!isLoading) {
|
||||||
|
return (
|
||||||
<>
|
<>
|
||||||
<ConnectionForm
|
<ConnectionForm
|
||||||
initialData={hostDetails}
|
initialData={hostDetails}
|
||||||
@@ -61,11 +66,8 @@ export const QbittorrentConnectionForm = (): ReactElement => {
|
|||||||
{JSON.stringify(qbittorrentClientInfo?.data, null, 4)}
|
{JSON.stringify(qbittorrentClientInfo?.data, null, 4)}
|
||||||
</pre>
|
</pre>
|
||||||
</>
|
</>
|
||||||
) : (
|
|
||||||
"Loading..."
|
|
||||||
)}
|
|
||||||
</>
|
|
||||||
);
|
);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
export default QbittorrentConnectionForm;
|
export default QbittorrentConnectionForm;
|
||||||
|
|||||||
@@ -93,6 +93,12 @@ export const ConnectionForm = ({
|
|||||||
{!isEmpty(initialData) ? "Update" : "Save"}
|
{!isEmpty(initialData) ? "Update" : "Save"}
|
||||||
</button>
|
</button>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
|
<p className="control">
|
||||||
|
<button type="submit" className="button is-danger">
|
||||||
|
{!isEmpty(initialData) && "Delete"}
|
||||||
|
</button>
|
||||||
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
)}
|
)}
|
||||||
|
|||||||
Reference in New Issue
Block a user