Skip to content

Commit aa16df3

Browse files
committed
Remove unneeded loading message
Signed-off-by: Trung Nguyen <[email protected]>
1 parent a0310ef commit aa16df3

File tree

2 files changed

+15
-25
lines changed

2 files changed

+15
-25
lines changed

src/extension/ui/src/components/tile/Index.tsx

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import {
1212
IconButton,
1313
Stack,
1414
TextField,
15-
Typography
15+
Typography,
1616
} from '@mui/material';
1717
import { useState } from 'react';
1818

@@ -139,12 +139,15 @@ const Tile = ({ item, client, registryLoading }: TileProps) => {
139139
</Stack>
140140
</DialogContent>
141141
</Dialog>
142-
{showConfigModal && <ConfigurationModal
143-
open={showConfigModal}
144-
onClose={() => setShowConfigModal(false)}
145-
catalogItem={item}
146-
client={client}
147-
/>}
142+
{showConfigModal && (
143+
<ConfigurationModal
144+
open={showConfigModal}
145+
onClose={() => setShowConfigModal(false)}
146+
catalogItem={item}
147+
client={client}
148+
registryLoading={registryLoading}
149+
/>
150+
)}
148151
<Card>
149152
<CardActionArea
150153
sx={{ padding: 1.5 }}

src/extension/ui/src/components/tile/Modal.tsx

Lines changed: 5 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ import {
2727
} from '@mui/material';
2828
import { useEffect, useState } from 'react';
2929
import { ASSIGNED_SECRET_PLACEHOLDER, MCP_POLICY_NAME } from '../../Constants';
30-
import { useCatalogAll, useCatalogOperations } from '../../queries/useCatalog';
30+
import { useCatalogOperations } from '../../queries/useCatalog';
3131
import { useConfig } from '../../queries/useConfig';
3232
import { useSecrets } from '../../queries/useSecrets';
3333
import { CatalogItemRichened } from '../../types/catalog';
@@ -61,13 +61,15 @@ interface ConfigurationModalProps {
6161
onClose: () => void;
6262
catalogItem: CatalogItemRichened;
6363
client: v1.DockerDesktopClient;
64+
registryLoading: boolean;
6465
}
6566

6667
const ConfigurationModal = ({
6768
open,
6869
onClose,
6970
catalogItem,
7071
client,
72+
registryLoading,
7173
}: ConfigurationModalProps) => {
7274
const [localSecrets, setLocalSecrets] = useState<
7375
{ [key: string]: string | undefined } | undefined
@@ -76,7 +78,6 @@ const ConfigurationModal = ({
7678

7779
const { isLoading: secretsLoading, mutate: mutateSecret } =
7880
useSecrets(client);
79-
const { registryLoading } = useCatalogAll(client);
8081
const { registerCatalogItem, unregisterCatalogItem } =
8182
useCatalogOperations(client);
8283
const { configLoading } = useConfig(client);
@@ -120,22 +121,8 @@ const ConfigurationModal = ({
120121
(!catalogItem.configSchema || catalogItem.configSchema.length === 0) &&
121122
(!catalogItem.secrets || catalogItem.secrets.length === 0);
122123

123-
if (secretsLoading || registryLoading || configLoading) {
124-
return (
125-
<>
126-
<CircularProgress />
127-
<Typography>Loading registry...</Typography>
128-
</>
129-
);
130-
}
131-
132-
if (!localSecrets) {
133-
return (
134-
<>
135-
<CircularProgress />
136-
<Typography>Loading secrets...</Typography>
137-
</>
138-
);
124+
if (secretsLoading || registryLoading || configLoading || !localSecrets) {
125+
return null;
139126
}
140127

141128
return (

0 commit comments

Comments
 (0)