diff --git a/client/src/app/pages/applications/applications-table/applications-table.tsx b/client/src/app/pages/applications/applications-table/applications-table.tsx index e387ec56d6..0e1c7b37c0 100644 --- a/client/src/app/pages/applications/applications-table/applications-table.tsx +++ b/client/src/app/pages/applications/applications-table/applications-table.tsx @@ -3,7 +3,6 @@ import React, { useState } from "react"; import { AxiosError } from "axios"; import { useHistory } from "react-router-dom"; import { Trans, useTranslation } from "react-i18next"; -import dayjs from "dayjs"; // @patternfly import { @@ -183,10 +182,6 @@ export const ApplicationsTable: React.FC = () => { const [reviewToDiscard, setReviewToDiscard] = useState(null); - const [endOfAppImportPeriod, setEndOfAppImportPeriod] = useState( - dayjs() - ); - const onChange = ( _event: React.FormEvent, value: string @@ -216,7 +211,7 @@ export const ApplicationsTable: React.FC = () => { // ----- Table data fetches and mutations const { tagItems } = useFetchTagsWithTagItems(); - const { tasks, hasActiveTasks } = useFetchTaskDashboard(isAnalyzeModalOpen); + const { tasks } = useFetchTaskDashboard(isAnalyzeModalOpen); const completedCancelTask = () => { pushNotification({ @@ -311,14 +306,12 @@ export const ApplicationsTable: React.FC = () => { return !!task && !TaskStates.Terminal.includes(task?.state ?? ""); }; - // TODO: Review the refetchInterval calculation for the application list + // TODO: Perf concerns for this query: https://github.com/konveyor/tackle2-ui/issues/2350 const { data: baseApplications, isFetching: isFetchingApplications, error: applicationsFetchError, - } = useFetchApplications(() => - hasActiveTasks || dayjs().isBefore(endOfAppImportPeriod) ? 5000 : false - ); + } = useFetchApplications(); const { applications, @@ -1264,7 +1257,6 @@ export const ApplicationsTable: React.FC = () => { { setIsApplicationImportModalOpen(false); - setEndOfAppImportPeriod(dayjs().add(15, "s")); }} /> diff --git a/client/src/app/queries/tasks.ts b/client/src/app/queries/tasks.ts index 1a982934f5..b350079aeb 100644 --- a/client/src/app/queries/tasks.ts +++ b/client/src/app/queries/tasks.ts @@ -79,7 +79,7 @@ export const useFetchTaskDashboard = (refetchDisabled: boolean = false) => { }); const hasActiveTasks = - data && data.some((task) => TaskStates.Queued.includes(task.state ?? "")); + data?.some((task) => TaskStates.Queued.includes(task.state ?? "")) ?? false; return { tasks: data || [],