From b90395ef1265c0434438b33ae9504eed5ff25845 Mon Sep 17 00:00:00 2001 From: schroda <50052685+schroda@users.noreply.github.com> Date: Sun, 5 May 2024 00:36:16 +0200 Subject: [PATCH] Prevent infinite loading in About --- src/screens/settings/About.tsx | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/src/screens/settings/About.tsx b/src/screens/settings/About.tsx index 396735e8..7cf6e74f 100644 --- a/src/screens/settings/About.tsx +++ b/src/screens/settings/About.tsx @@ -203,7 +203,6 @@ export function About() { useSetDefaultBackTo('settings'); const { data, loading, error, refetch } = requestManager.useGetAbout({ notifyOnNetworkStatusChange: true }); - const { aboutServer, aboutWebUI } = data ?? {}; const { data: serverUpdateCheckData, @@ -225,17 +224,6 @@ export function About() { progress: 0, }; - if (!aboutServer || !aboutWebUI) { - return ; - } - - const selectedServerChannelInfo = serverUpdateCheckData?.checkForServerUpdates?.find( - (channel) => channel.channel === aboutServer.buildType, - ); - const isServerUpdateAvailable = - !!selectedServerChannelInfo?.tag && selectedServerChannelInfo.tag !== getVersion(aboutServer); - const isWebUIUpdateAvailable = !!webUIUpdateData?.checkForWebUIUpdate.updateAvailable; - if (loading) { return ; } @@ -250,6 +238,14 @@ export function About() { ); } + const { aboutServer, aboutWebUI } = data!; + const selectedServerChannelInfo = serverUpdateCheckData?.checkForServerUpdates?.find( + (channel) => channel.channel === aboutServer.buildType, + ); + const isServerUpdateAvailable = + !!selectedServerChannelInfo?.tag && selectedServerChannelInfo.tag !== getVersion(aboutServer); + const isWebUIUpdateAvailable = !!webUIUpdateData?.checkForWebUIUpdate.updateAvailable; + return (