jnfrati пре 4 година
родитељ
комит
f26026c01c

+ 9 - 4
dashboard/src/main/home/cluster-dashboard/dashboard/events/EventsTab.tsx

@@ -38,7 +38,6 @@ const EventsTab = () => {
 
   const [isLoading, setIsLoading] = useState(true);
   const [kubeEvents, setKubeEvents] = useState<KubeEvent[]>([]);
-  const [hasErrors, setHasErrors] = useState(false);
   const [hasMore, setHasMore] = useState(true);
   const [resourceType, setResourceType] = useState(availableResourceTypes[0]);
 
@@ -63,7 +62,9 @@ const EventsTab = () => {
   }, [currentProject, currentCluster]);
 
   useEffect(() => {
-    fetchData(true);
+    fetchData(true).then(() => {
+      setIsLoading(false);
+    });
   }, [
     currentProject?.id,
     currentCluster?.id,
@@ -110,8 +111,6 @@ const EventsTab = () => {
           setHasMore(true);
         }
       }
-
-      setIsLoading(false);
     } catch (error) {
       console.log(error);
     }
@@ -142,6 +141,12 @@ const EventsTab = () => {
     };
   };
 
+  if (isLoading) {
+    <Placeholder>
+      <Loading />
+    </Placeholder>;
+  }
+
   if (!hasPorterAgent) {
     return (
       <Placeholder>