From 85e05d595de05845279a60387e7063ca5d77140f Mon Sep 17 00:00:00 2001 From: Bill Thornton Date: Fri, 20 Oct 2023 13:48:03 -0400 Subject: [PATCH 1/2] Handle json parse error when testing urls --- src/utils/dashboard.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/utils/dashboard.js b/src/utils/dashboard.js index 1815dae241..4cca230cc2 100644 --- a/src/utils/dashboard.js +++ b/src/utils/dashboard.js @@ -56,9 +56,16 @@ export async function serverAddress() { return; } + let config; + try { + config = await resp.json(); + } catch (err) { + return; + } + return { url, - config: await resp.json() + config }; }).catch(error => { console.error(error); From 1c6b0d75efe22466dd2a6f2770c2047dae6aff8f Mon Sep 17 00:00:00 2001 From: Bill Thornton Date: Fri, 20 Oct 2023 16:31:40 -0400 Subject: [PATCH 2/2] Fix boucing to select server when already there --- src/components/ConnectionRequired.tsx | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/components/ConnectionRequired.tsx b/src/components/ConnectionRequired.tsx index ca6c26b091..5d29088e8c 100644 --- a/src/components/ConnectionRequired.tsx +++ b/src/components/ConnectionRequired.tsx @@ -53,8 +53,12 @@ const ConnectionRequired: FunctionComponent = ({ return; case ConnectionState.ServerSelection: // Bounce to select server page - console.debug('[ConnectionRequired] redirecting to select server page'); - navigate(BounceRoutes.SelectServer); + if (location.pathname === BounceRoutes.SelectServer) { + setIsLoading(false); + } else { + console.debug('[ConnectionRequired] redirecting to select server page'); + navigate(BounceRoutes.SelectServer); + } return; case ConnectionState.ServerUpdateNeeded: // Show update needed message and bounce to select server page