Skip to content

Commit f551664

Browse files
committed
Remove the showMine check
Signed-off-by: David Gageot <[email protected]>
1 parent 91a6555 commit f551664

File tree

2 files changed

+2
-29
lines changed

2 files changed

+2
-29
lines changed

src/extension/ui/src/components/CatalogGrid.tsx

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,6 @@ export const CatalogGrid: React.FC<CatalogGridProps> = ({ appProps }) => {
4040

4141
const [search, setSearch] = useState<string>('');
4242
const [tab, setTab] = useState<number>(0);
43-
const [showMine, setShowMine] = useState<boolean>(
44-
localStorage.getItem('showMine') === 'true'
45-
);
4643
const [openMenus, setOpenMenus] = useState<{
4744
[key: string]: { anchorEl: HTMLElement | null; open: boolean };
4845
}>({
@@ -174,21 +171,6 @@ export const CatalogGrid: React.FC<CatalogGridProps> = ({ appProps }) => {
174171
>
175172
<SwapVert fontSize="small" />
176173
</IconButton>
177-
<FormControlLabel
178-
control={
179-
<Switch
180-
checked={showMine}
181-
onChange={(e) => {
182-
setShowMine(e.target.checked);
183-
localStorage.setItem(
184-
'showMine',
185-
e.target.checked.toString()
186-
);
187-
}}
188-
/>
189-
}
190-
label="Show only enabled tools"
191-
/>
192174
</Stack>
193175
</FormGroup>
194176

@@ -246,7 +228,6 @@ export const CatalogGrid: React.FC<CatalogGridProps> = ({ appProps }) => {
246228
{tab === 0 && (
247229
<ToolCatalog
248230
search={search}
249-
showMine={showMine}
250231
client={client}
251232
sort={sort}
252233
/>

src/extension/ui/src/components/tabs/ToolCatalog.tsx

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,12 @@ import Tile from '../tile/Index';
1010
interface ToolCatalogProps {
1111
search: string;
1212
client: v1.DockerDesktopClient;
13-
showMine: boolean;
1413
sort: 'name-asc' | 'name-desc';
1514
}
1615

1716
const ToolCatalog: React.FC<ToolCatalogProps> = ({
1817
search,
1918
client,
20-
showMine,
2119
sort,
2220
}) => {
2321
const { catalogItems, registryLoading } = useCatalogAll(client);
@@ -27,11 +25,7 @@ const ToolCatalog: React.FC<ToolCatalogProps> = ({
2725
// Memoize the filtered catalog items to prevent unnecessary recalculations
2826
const result = useMemo(() => {
2927
const filteredItems = catalogItems.filter((item) => {
30-
const matchesSearch = item.name
31-
.toLowerCase()
32-
.includes(search.toLowerCase());
33-
const hideBecauseItsNotMine = showMine && !item.registered;
34-
return matchesSearch && !hideBecauseItsNotMine;
28+
return item.name.toLowerCase().includes(search.toLowerCase());
3529
});
3630

3731
return sort === 'name-asc'
@@ -43,9 +37,7 @@ const ToolCatalog: React.FC<ToolCatalogProps> = ({
4337
return b.name.localeCompare(a.name);
4438
})
4539
: filteredItems;
46-
}, [catalogItems, search, showMine, sort]);
47-
48-
40+
}, [catalogItems, search, sort]);
4941

5042
return (
5143
<>

0 commit comments

Comments
 (0)