Skip to content

Commit

Permalink
Add check for cluster loading to datastore dashboard (#4203)
Browse files Browse the repository at this point in the history
  • Loading branch information
Feroze Mohideen authored Jan 26, 2024
1 parent bc54821 commit 5438783
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions dashboard/src/main/home/database-dashboard/DatabaseDashboard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ import EngineTag from "./tags/EngineTag";

const DatabaseDashboard: React.FC = () => {
const { currentCluster } = useContext(Context);
const { clusters } = useClusterList();
const { clusters, isLoading: isLoadingClusters } = useClusterList();

const [searchValue, setSearchValue] = useState("");
const [view, setView] = useState<"grid" | "list">("grid");
Expand Down Expand Up @@ -81,6 +81,10 @@ const DatabaseDashboard: React.FC = () => {
}, [datastores, searchValue, typeFilter, engineFilter]);

const renderContents = (): JSX.Element => {
if (datastores === undefined || isLoading || isLoadingClusters) {
return <Loading offset="-150px" />;
}

if (clusters.filter(isAWSCluster).length === 0) {
return (
<Fieldset>
Expand All @@ -107,10 +111,6 @@ const DatabaseDashboard: React.FC = () => {
return <ClusterProvisioningPlaceholder />;
}

if (datastores === undefined || isLoading) {
return <Loading offset="-150px" />;
}

if (datastores.length === 0) {
return (
<DashboardPlaceholder>
Expand Down

0 comments on commit 5438783

Please sign in to comment.