Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

Menu

Manav Rathi3936954ee237
diff --git a/web/apps/photos/src/components/Sidebar.tsx b/web/apps/photos/src/components/Sidebar.tsx
index 2614fe0fa9..e64decd920 100644
--- a/web/apps/photos/src/components/Sidebar.tsx
+++ b/web/apps/photos/src/components/Sidebar.tsx
@@ -934,15 +934,26 @@ const AdvancedSettings: React.FC<NestedSidebarDrawerVisibilityProps> = ({
onRootClose,
}) => {
const { cfUploadProxyDisabled } = useSettingsSnapshot();
+ const [isAutoLaunchEnabled, setIsAutoLaunchEnabled] = useState(false);
+
+ const electron = globalThis.electron;
+
+ useEffect(() => {
+ void electron
+ ?.isAutoLaunchEnabled()
+ .then((enabled) => setIsAutoLaunchEnabled(enabled));
+ }, [electron]);
const handleRootClose = () => {
onClose();
onRootClose();
};
- const toggle = () =>
+ const toggleProxy = () =>
void updateCFProxyDisabledPreference(!cfUploadProxyDisabled);
+ const toggleAutoLaunch = () => void electron?.toggleAutoLaunch();
+
return (
<NestedSidebarDrawer
{...{ open, onClose }}
@@ -954,27 +965,28 @@ const AdvancedSettings: React.FC<NestedSidebarDrawerVisibilityProps> = ({
onRootClose={handleRootClose}
title={t("advanced")}
/>
-
<Stack sx={{ px: "16px", py: "20px", gap: "24px" }}>
- <Stack >
+ <Stack>
<RowButtonGroup>
<RowSwitch
label={t("faster_upload")}
checked={!cfUploadProxyDisabled}
- onClick={toggle}
+ onClick={toggleProxy}
/>
</RowButtonGroup>
<RowButtonGroupHint>
{t("faster_upload_description")}
</RowButtonGroupHint>
</Stack>
- <RowButtonGroup>
- <RowSwitch
- label={t("open_ente_on_startup")}
- checked={!cfUploadProxyDisabled}
- onClick={toggle}
- />
- </RowButtonGroup>
+ {electron && (
+ <RowButtonGroup>
+ <RowSwitch
+ label={t("open_ente_on_startup")}
+ checked={isAutoLaunchEnabled}
+ onClick={toggleAutoLaunch}
+ />
+ </RowButtonGroup>
+ )}
</Stack>
</Stack>
</NestedSidebarDrawer>
diff --git a/web/packages/base/locales/en-US/translation.json b/web/packages/base/locales/en-US/translation.json
index 146066b483..25b8989ab5 100644
--- a/web/packages/base/locales/en-US/translation.json
+++ b/web/packages/base/locales/en-US/translation.json
@@ -604,6 +604,7 @@
"reset": "Reset",
"faster_upload": "Faster uploads",
"faster_upload_description": "Route uploads through nearby servers",
+ "open_ente_on_startup": "Open Ente on startup",
"cast_album_to_tv": "Play album on TV",
"enter_cast_pin_code": "Enter the code you see on the TV below to pair this device.",
"code": "Code",