Skip to content

armgit / ente

Public Imported from GitHub
0

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

Merge branch 'main' into expanding-spotlight

Aswin Asokbf6d375eb101
diff --cc web/apps/photos/src/components/Sidebar.tsx
index 74ae482d5d,2809f2631b..76b098d64f
--- a/web/apps/photos/src/components/Sidebar.tsx
+++ b/web/apps/photos/src/components/Sidebar.tsx
@@@ -905,54 -707,19 +908,59 @@@ const Account: React.FC<AccountProps>
onRootClose();
};
- const handleChangePassword = () => router.push("/change-password");
- const handleChangeEmail = () => router.push("/change-email");
+ const handleChangePassword = useCallback(() => {
+ void router.push("/change-password");
+ }, [router]);
+ const handleChangeEmail = useCallback(() => {
+ void router.push("/change-email");
+ }, [router]);
- const handlePasskeys = async () => {
+ const handlePasskeys = useCallback(async () => {
onRootClose();
await openAccountsManagePasskeysPage();
- };
+ }, [onRootClose]);
+
+ useEffect(() => {
+ if (!open || !pendingAction) return;
+ switch (pendingAction) {
+ case "account.recoveryKey":
+ showRecoveryKey();
+ break;
+ case "account.twoFactor.reconfigure":
+ case "account.twoFactor":
+ showTwoFactor();
+ break;
+ case "account.passkeys":
+ void handlePasskeys();
+ break;
+ case "account.changePassword":
+ handleChangePassword();
+ break;
+ case "account.changeEmail":
+ handleChangeEmail();
+ break;
+ case "account.deleteAccount":
+ showDeleteAccount();
+ break;
+ }
+ onActionHandled?.();
+ }, [
+ handleChangeEmail,
+ handleChangePassword,
+ handlePasskeys,
+ open,
+ onActionHandled,
+ pendingAction,
+ showDeleteAccount,
+ showRecoveryKey,
+ showTwoFactor,
+ ]);
+ const handleActiveSessions = async () => {
+ await onAuthenticateUser();
+ showSessions();
+ };
+
return (
<TitledNestedSidebarDrawer
{...{ open, onClose }}
diff --cc web/apps/photos/src/pages/gallery.tsx
index 19dbddd940,7de61b0505..fd64f4075a
--- a/web/apps/photos/src/pages/gallery.tsx
+++ b/web/apps/photos/src/pages/gallery.tsx
@@@ -232,10 -259,15 +265,18 @@@ const Page: React.FC = () =>
const { show: showAlbumNameInput, props: albumNameInputVisibilityProps } =
useModalVisibility();
+ // Progress UI state for single-file add-to-album from the FileViewer
+ const [addToAlbumProgress, setAddToAlbumProgress] = useState<{
+ open: boolean;
+ phase: AddToAlbumPhase;
+ albumId?: number;
+ albumName?: string;
+ }>({ open: false, phase: "processing" });
+
const onAuthenticateCallback = useRef<(() => void) | undefined>(undefined);
+ const onAuthenticateCancelCallback = useRef<(() => void) | undefined>(
+ undefined,
+ );
const authenticateUser = useCallback(
() =>