slightly cleaner loading (#2776)

This commit is contained in:
pablodanswer 2024-10-12 18:44:28 -07:00 committed by GitHub
parent 20df20ae51
commit 40dc4708d2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -27,11 +27,11 @@ export default function UpgradingPage({
const [isCancelling, setIsCancelling] = useState<boolean>(false);
const { setPopup, popup } = usePopup();
const { data: connectors } = useSWR<Connector<any>[]>(
"/api/manage/connector",
errorHandlingFetcher,
{ refreshInterval: 5000 } // 5 seconds
);
const { data: connectors, isLoading: isLoadingConnectors } = useSWR<
Connector<any>[]
>("/api/manage/connector", errorHandlingFetcher, {
refreshInterval: 5000, // 5 seconds
});
const {
data: ongoingReIndexingStatus,
@ -90,6 +90,10 @@ export default function UpgradingPage({
});
}, [ongoingReIndexingStatus]);
if (isLoadingConnectors || isLoadingOngoingReIndexingStatus) {
return <ThreeDotsLoader />;
}
return (
<>
{popup}
@ -150,9 +154,7 @@ export default function UpgradingPage({
downtime is necessary during this transition.
</Text>
{isLoadingOngoingReIndexingStatus ? (
<ThreeDotsLoader />
) : sortedReindexingProgress ? (
{sortedReindexingProgress ? (
<ReindexingProgressTable
reindexingProgress={sortedReindexingProgress}
/>