Skip to content

Commit

Permalink
[web] Show ML option only on desktop (#2997)
Browse files Browse the repository at this point in the history
This had been accidentally left enabled on web. The ML wouldn't run,
just the option was being shown.
  • Loading branch information
mnvr authored Aug 27, 2024
2 parents e25d439 + 520d893 commit 49895a7
Showing 1 changed file with 15 additions and 12 deletions.
27 changes: 15 additions & 12 deletions web/apps/photos/src/components/Sidebar/Preferences.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import {
type SupportedLocale,
} from "@/base/i18n";
import { MLSettings } from "@/new/photos/components/MLSettings";
import { isMLSupported } from "@/new/photos/services/ml";
import { EnteMenuItem } from "@ente/shared/components/Menu/EnteMenuItem";
import ChevronRight from "@mui/icons-material/ChevronRight";
import ScienceIcon from "@mui/icons-material/Science";
Expand Down Expand Up @@ -78,19 +79,21 @@ export const Preferences: React.FC<SettingsDrawerProps> = ({
endIcon={<ChevronRight />}
label={t("advanced")}
/>
<Box>
<MenuSectionTitle
title={t("labs")}
icon={<ScienceIcon />}
/>
<MenuItemGroup>
<EnteMenuItem
endIcon={<ChevronRight />}
onClick={() => setOpenMLSettings(true)}
label={t("ml_search")}
{isMLSupported && (
<Box>
<MenuSectionTitle
title={t("labs")}
icon={<ScienceIcon />}
/>
</MenuItemGroup>
</Box>
<MenuItemGroup>
<EnteMenuItem
endIcon={<ChevronRight />}
onClick={() => setOpenMLSettings(true)}
label={t("ml_search")}
/>
</MenuItemGroup>
</Box>
)}
</Stack>
</Box>
</Stack>
Expand Down

0 comments on commit 49895a7

Please sign in to comment.