Skip to content

Commit 8a5c907

Browse files
committed
fix(Cluster): show loader if capabilities not loaded
1 parent d590f05 commit 8a5c907

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

src/containers/App/Content.tsx

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -178,8 +178,7 @@ function DataWrapper({children}: {children: React.ReactNode}) {
178178
return (
179179
<GetUser>
180180
<GetNodesList />
181-
<GetCapabilities />
182-
{children}
181+
<GetCapabilities>{children}</GetCapabilities>
183182
</GetUser>
184183
);
185184
}
@@ -199,9 +198,14 @@ function GetNodesList() {
199198
return null;
200199
}
201200

202-
function GetCapabilities() {
203-
useCapabilitiesQuery();
204-
return null;
201+
function GetCapabilities({children}: {children: React.ReactNode}) {
202+
const {isLoading} = useCapabilitiesQuery();
203+
204+
return (
205+
<LoaderWrapper loading={isLoading} size="l">
206+
{children}
207+
</LoaderWrapper>
208+
);
205209
}
206210

207211
interface ContentWrapperProps {

src/store/reducers/capabilities/hooks.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ function useDatabaseFromQuery() {
1515
export function useCapabilitiesQuery() {
1616
const database = useDatabaseFromQuery();
1717

18-
capabilitiesApi.useGetClusterCapabilitiesQuery({database});
18+
return capabilitiesApi.useGetClusterCapabilitiesQuery({database});
1919
}
2020

2121
export function useCapabilitiesLoaded() {

0 commit comments

Comments
 (0)