Skip to content

Commit

Permalink
fix(Cluster): show loader if capabilities not loaded
Browse files Browse the repository at this point in the history
  • Loading branch information
Raubzeug committed Dec 25, 2024
1 parent d590f05 commit 8a5c907
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
14 changes: 9 additions & 5 deletions src/containers/App/Content.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -178,8 +178,7 @@ function DataWrapper({children}: {children: React.ReactNode}) {
return (
<GetUser>
<GetNodesList />
<GetCapabilities />
{children}
<GetCapabilities>{children}</GetCapabilities>
</GetUser>
);
}
Expand All @@ -199,9 +198,14 @@ function GetNodesList() {
return null;
}

function GetCapabilities() {
useCapabilitiesQuery();
return null;
function GetCapabilities({children}: {children: React.ReactNode}) {
const {isLoading} = useCapabilitiesQuery();

return (
<LoaderWrapper loading={isLoading} size="l">
{children}
</LoaderWrapper>
);
}

interface ContentWrapperProps {
Expand Down
2 changes: 1 addition & 1 deletion src/store/reducers/capabilities/hooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ function useDatabaseFromQuery() {
export function useCapabilitiesQuery() {
const database = useDatabaseFromQuery();

capabilitiesApi.useGetClusterCapabilitiesQuery({database});
return capabilitiesApi.useGetClusterCapabilitiesQuery({database});
}

export function useCapabilitiesLoaded() {
Expand Down

0 comments on commit 8a5c907

Please sign in to comment.