From 1f8dded15ec625e1a1add45efd651452346872ec Mon Sep 17 00:00:00 2001 From: Rishi Ghan Date: Sat, 4 Nov 2023 23:44:25 -0400 Subject: [PATCH] =?UTF-8?q?=F0=9F=8F=97=20Added=20error=20check=20state?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../QbittorrentConnectionForm.tsx | 38 ++++++++++--------- .../shared/ConnectionForm/ConnectionForm.tsx | 6 +++ 2 files changed, 26 insertions(+), 18 deletions(-) diff --git a/src/client/components/Settings/QbittorrentSettings/QbittorrentConnectionForm.tsx b/src/client/components/Settings/QbittorrentSettings/QbittorrentConnectionForm.tsx index 0634a69..8a8f8df 100644 --- a/src/client/components/Settings/QbittorrentSettings/QbittorrentConnectionForm.tsx +++ b/src/client/components/Settings/QbittorrentSettings/QbittorrentConnectionForm.tsx @@ -47,25 +47,27 @@ export const QbittorrentConnectionForm = (): ReactElement => { }), }); - return ( - <> - {!isLoading ? ( - <> - + if (isError) + return ( + <> +
Something went wrong connecting to qBittorrent.
+ + ); + if (!isLoading) { + return ( + <> + -
-            {JSON.stringify(qbittorrentClientInfo?.data, null, 4)}
-          
- - ) : ( - "Loading..." - )} - - ); +
+          {JSON.stringify(qbittorrentClientInfo?.data, null, 4)}
+        
+ + ); + } }; export default QbittorrentConnectionForm; diff --git a/src/client/components/shared/ConnectionForm/ConnectionForm.tsx b/src/client/components/shared/ConnectionForm/ConnectionForm.tsx index 5de58bc..a6b2ccd 100644 --- a/src/client/components/shared/ConnectionForm/ConnectionForm.tsx +++ b/src/client/components/shared/ConnectionForm/ConnectionForm.tsx @@ -93,6 +93,12 @@ export const ConnectionForm = ({ {!isEmpty(initialData) ? "Update" : "Save"}

+ +

+ +

)}