Prevent infinite loading in About
This commit is contained in:
@@ -203,7 +203,6 @@ export function About() {
|
|||||||
useSetDefaultBackTo('settings');
|
useSetDefaultBackTo('settings');
|
||||||
|
|
||||||
const { data, loading, error, refetch } = requestManager.useGetAbout({ notifyOnNetworkStatusChange: true });
|
const { data, loading, error, refetch } = requestManager.useGetAbout({ notifyOnNetworkStatusChange: true });
|
||||||
const { aboutServer, aboutWebUI } = data ?? {};
|
|
||||||
|
|
||||||
const {
|
const {
|
||||||
data: serverUpdateCheckData,
|
data: serverUpdateCheckData,
|
||||||
@@ -225,17 +224,6 @@ export function About() {
|
|||||||
progress: 0,
|
progress: 0,
|
||||||
};
|
};
|
||||||
|
|
||||||
if (!aboutServer || !aboutWebUI) {
|
|
||||||
return <LoadingPlaceholder />;
|
|
||||||
}
|
|
||||||
|
|
||||||
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) {
|
if (loading) {
|
||||||
return <LoadingPlaceholder />;
|
return <LoadingPlaceholder />;
|
||||||
}
|
}
|
||||||
@@ -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 (
|
return (
|
||||||
<List>
|
<List>
|
||||||
<List
|
<List
|
||||||
|
|||||||
Reference in New Issue
Block a user