Skip to content

armgit / ente

Public Imported from GitHub
0

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

refresh

Manav Rathib9fb797a1541
diff --git a/web/apps/photos/src/components/Sidebar.tsx b/web/apps/photos/src/components/Sidebar.tsx
index e64decd920..10bb3a82cf 100644
--- a/web/apps/photos/src/components/Sidebar.tsx
+++ b/web/apps/photos/src/components/Sidebar.tsx
@@ -938,12 +938,17 @@ const AdvancedSettings: React.FC<NestedSidebarDrawerVisibilityProps> = ({
const electron = globalThis.electron;
- useEffect(() => {
- void electron
+ const refreshAutoLaunchEnabled = useCallback(async () => {
+ return electron
?.isAutoLaunchEnabled()
.then((enabled) => setIsAutoLaunchEnabled(enabled));
}, [electron]);
+ useEffect(
+ () => void refreshAutoLaunchEnabled(),
+ [refreshAutoLaunchEnabled],
+ );
+
const handleRootClose = () => {
onClose();
onRootClose();
@@ -952,7 +957,8 @@ const AdvancedSettings: React.FC<NestedSidebarDrawerVisibilityProps> = ({
const toggleProxy = () =>
void updateCFProxyDisabledPreference(!cfUploadProxyDisabled);
- const toggleAutoLaunch = () => void electron?.toggleAutoLaunch();
+ const toggleAutoLaunch = () =>
+ void electron?.toggleAutoLaunch().then(refreshAutoLaunchEnabled);
return (
<NestedSidebarDrawer