Skip to content

armgit / ente

Public Imported from GitHub
0

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

fix(settings):reset-nested-state-on-section-switch

Aswin Asok759e4df02a60
diff --git a/web/apps/photos/src/components/sidebar/Sidebar.tsx b/web/apps/photos/src/components/sidebar/Sidebar.tsx
index 86e2d801f6..b3067f999e 100644
--- a/web/apps/photos/src/components/sidebar/Sidebar.tsx
+++ b/web/apps/photos/src/components/sidebar/Sidebar.tsx
@@ -698,43 +698,53 @@ const UtilitySection: React.FC<UtilitySectionProps> = ({
}
onClick={onShowExport}
/>
- <Help
- {...helpVisibilityProps}
- onRootClose={onCloseSidebar}
- pendingAction={pendingHelpAction}
- onActionHandled={onHelpActionHandled}
- />
- {isDesktop && (
+ {helpVisibilityProps.open && (
+ <Help
+ {...helpVisibilityProps}
+ onRootClose={onCloseSidebar}
+ pendingAction={pendingHelpAction}
+ onActionHandled={onHelpActionHandled}
+ />
+ )}
+ {isDesktop && watchFolderView && (
<WatchFolder
open={watchFolderView}
onClose={onCloseWatchFolder}
onRootClose={onCloseSidebar}
/>
)}
- <Account
- {...accountVisibilityProps}
- onRootClose={onCloseSidebar}
- pendingAction={pendingAccountAction}
- onActionHandled={onAccountActionHandled}
- {...{ onAuthenticateUser, onShowPlanSelector }}
- />
- <ReferralSettings
- {...referralsVisibilityProps}
- onRootClose={onCloseSidebar}
- />
- <Preferences
- {...preferencesVisibilityProps}
- onRootClose={onCloseSidebar}
- pendingAction={pendingPreferencesAction}
- onActionHandled={onPreferencesActionHandled}
- onAuthenticateUser={onAuthenticateUser}
- />
- <FreeUpSpace
- {...freeUpSpaceVisibilityProps}
- onRootClose={onCloseSidebar}
- pendingAction={pendingFreeUpSpaceAction}
- onActionHandled={onFreeUpSpaceActionHandled}
- />
+ {accountVisibilityProps.open && (
+ <Account
+ {...accountVisibilityProps}
+ onRootClose={onCloseSidebar}
+ pendingAction={pendingAccountAction}
+ onActionHandled={onAccountActionHandled}
+ {...{ onAuthenticateUser, onShowPlanSelector }}
+ />
+ )}
+ {referralsVisibilityProps.open && (
+ <ReferralSettings
+ {...referralsVisibilityProps}
+ onRootClose={onCloseSidebar}
+ />
+ )}
+ {preferencesVisibilityProps.open && (
+ <Preferences
+ {...preferencesVisibilityProps}
+ onRootClose={onCloseSidebar}
+ pendingAction={pendingPreferencesAction}
+ onActionHandled={onPreferencesActionHandled}
+ onAuthenticateUser={onAuthenticateUser}
+ />
+ )}
+ {freeUpSpaceVisibilityProps.open && (
+ <FreeUpSpace
+ {...freeUpSpaceVisibilityProps}
+ onRootClose={onCloseSidebar}
+ pendingAction={pendingFreeUpSpaceAction}
+ onActionHandled={onFreeUpSpaceActionHandled}
+ />
+ )}
</>
);
};
diff --git a/web/apps/photos/src/pages/gallery.tsx b/web/apps/photos/src/pages/gallery.tsx
index 6545de24cb..ef97db15a7 100644
--- a/web/apps/photos/src/pages/gallery.tsx
+++ b/web/apps/photos/src/pages/gallery.tsx
@@ -1864,10 +1864,12 @@ const Page: React.FC = () => {
setLoading={(v) => setBlockingLoad(v)}
onManageFamily={showFamilyManagement}
/>
- <FamilyManagement
- {...familyManagementVisibilityProps}
- onShowPlanSelector={showPlanSelector}
- />
+ {familyManagementVisibilityProps.open && (
+ <FamilyManagement
+ {...familyManagementVisibilityProps}
+ onShowPlanSelector={showPlanSelector}
+ />
+ )}
</>
);
@@ -2056,11 +2058,13 @@ const Page: React.FC = () => {
onAuthenticateUser={authenticateUser}
>
{sidebarVisibilityProps.open && subscriptionDialogs}
- <Export
- {...exportVisibilityProps}
- {...{ collectionNameByID }}
- onRootClose={handleSidebarClose}
- />
+ {exportVisibilityProps.open && (
+ <Export
+ {...exportVisibilityProps}
+ {...{ collectionNameByID }}
+ onRootClose={handleSidebarClose}
+ />
+ )}
</Sidebar>
<WhatsNew {...whatsNewVisibilityProps} />
<AssignPersonDialog