Skip to content

armgit / ente

Public Imported from GitHub
0

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

Ignore cancels

Manav Rathia4799a290976
diff --git a/web/apps/accounts/src/pages/passkeys/index.tsx b/web/apps/accounts/src/pages/passkeys/index.tsx
index 77c2438b00..5fe551ebfa 100644
--- a/web/apps/accounts/src/pages/passkeys/index.tsx
+++ b/web/apps/accounts/src/pages/passkeys/index.tsx
@@ -89,8 +89,16 @@ const Page: React.FC = () => {
await registerPasskey(inputValue);
} catch (e) {
log.error("Failed to register a new passkey", e);
- // TODO-PK: localize
- setFieldError("Could not add passkey");
+ // If the user cancels the operation, then an error with name
+ // "NotAllowedError" is thrown.
+ //
+ // Ignore this, but in other cases add an error indicator to the add
+ // passkey text field. The browser is expected to already have shown
+ // an error dialog to the user.
+ if (!(e instanceof Error && e.name == "NotAllowedError")) {
+ // TODO-PK: localize
+ setFieldError("Could not add passkey");
+ }
return;
}
await refreshPasskeys();