Просмотр исходного кода

prevent loading jobs if the user is viewing applications

jnfrati 4 лет назад
Родитель
Сommit
c917184ea1
1 измененных файлов с 9 добавлено и 1 удалено
  1. 9 1
      dashboard/src/main/home/cluster-dashboard/chart/ChartList.tsx

+ 9 - 1
dashboard/src/main/home/cluster-dashboard/chart/ChartList.tsx

@@ -360,6 +360,10 @@ const ChartList: React.FunctionComponent<Props> = ({
   };
 
   useEffect(() => {
+    if (currentView === "applications") {
+      return () => {};
+    }
+
     if (!charts?.length) {
       return () => {};
     }
@@ -476,11 +480,15 @@ const ChartList: React.FunctionComponent<Props> = ({
   }, [charts, sortType, jobStatus, lastRunStatus]);
 
   const isLoadingJobStatus = useMemo(() => {
+    if (currentView === "applications") {
+      return false;
+    }
+
     if (lastStreamStatus.current !== "finished") {
       return true;
     }
     return false;
-  }, [jobStatus]);
+  }, [jobStatus, currentView]);
 
   const renderChartList = () => {
     if (isLoading || (!namespace && namespace !== "")) {