Skip to content

armgit / ente

Public Imported from GitHub
0

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

fix(DeleteAccount):handle-onAuthenticateUser-closure

Aswin Asok99928304f79f
diff --git a/web/apps/photos/src/components/DeleteAccount.tsx b/web/apps/photos/src/components/DeleteAccount.tsx
index 7ace0be7a7..c1ffec3d9b 100644
--- a/web/apps/photos/src/components/DeleteAccount.tsx
+++ b/web/apps/photos/src/components/DeleteAccount.tsx
@@ -174,7 +174,18 @@ const DeleteAccountDialogContents: React.FC<
await getAccountDeleteChallenge();
if (allowDelete && encryptedChallenge) {
- await onAuthenticateUser();
+ try {
+ await onAuthenticateUser();
+ } catch (e) {
+ const wasCancelled =
+ e == undefined ||
+ (e instanceof Error &&
+ e.message ===
+ "app_lock_reauthentication_cancelled");
+ if (!wasCancelled) onGenericError(e);
+ setLoading(false);
+ return;
+ }
const decryptedChallenge =
await decryptDeleteAccountChallenge(encryptedChallenge);
await deleteAccount(