Skip to content

armgit / ente

Public Imported from GitHub
0

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

fix(AppLock):add-feature-flag

Aswin Asok3eb447e12be6
diff --git a/web/apps/photos/.env b/web/apps/photos/.env
index ff749bb0a6..cff75bb577 100644
--- a/web/apps/photos/.env
+++ b/web/apps/photos/.env
@@ -80,3 +80,4 @@
# NEXT_PUBLIC_ENTE_TEST_EXPECTED_JSON = {}
NEXT_TELEMETRY_DISABLED = 1
+NEXT_PUBLIC_ENTE_ENABLE_APP_LOCK = false
\ No newline at end of file
diff --git a/web/apps/photos/src/components/Sidebar.tsx b/web/apps/photos/src/components/Sidebar.tsx
index 84fd2a039e..148573e656 100644
--- a/web/apps/photos/src/components/Sidebar.tsx
+++ b/web/apps/photos/src/components/Sidebar.tsx
@@ -245,6 +245,9 @@ type FreeUpSpaceAction = Extract<
const appLockReauthenticationCancelledMessage =
"app_lock_reauthentication_cancelled";
+const isAppLockFeatureEnabled =
+ process.env.NEXT_PUBLIC_ENTE_ENABLE_APP_LOCK == "true";
+
const isReauthenticationCancellation = (error: unknown) =>
error == undefined ||
(error instanceof Error &&
@@ -1113,7 +1116,7 @@ const Account: React.FC<AccountProps> = ({
onClick={handleActiveSessions}
/>
</RowButtonGroup>
- {isDesktop && (
+ {isDesktop && isAppLockFeatureEnabled && (
<DesktopAppLockSettings
onAuthenticateUser={onAuthenticateUser}
onRootClose={onRootClose}
@@ -1173,14 +1176,14 @@ const DesktopAppLockSettings: React.FC<
}
}, [onAuthenticateUser, show]);
- return (
+ return isAppLockFeatureEnabled ? (
<>
<RowButtonGroup>
<RowButton label={t("app_lock")} onClick={handleOpen} />
</RowButtonGroup>
<AppLockSettings {...props} onRootClose={onRootClose} />
</>
- );
+ ) : null;
};
type PreferencesProps = NestedSidebarDrawerVisibilityProps & {