This commit is contained in:
Manav Rathi 2025-02-07 13:55:35 +05:30
parent 1b83acb262
commit 3936954ee2
No known key found for this signature in database
2 changed files with 24 additions and 11 deletions

View File

@ -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>

View File

@ -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",