Skip to content

Commit

Permalink
fix(authenticator): Display loading error if authenticator is null
Browse files Browse the repository at this point in the history
  • Loading branch information
ArthurKnaus committed Aug 28, 2024
1 parent c034581 commit 4d9ba3d
Showing 1 changed file with 2 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ function AccountSecurityDetails({deleteDisabled, onRegenerateBackupCodes}: Props
);

const handleRemove = (device?: AuthenticatorDevice) => {
if (!authenticator || !authenticator.authId) {
if (!authenticator?.authId) {
return;
}
remove({id: authenticator.authId, device});
Expand All @@ -136,14 +136,10 @@ function AccountSecurityDetails({deleteDisabled, onRegenerateBackupCodes}: Props
return <LoadingIndicator />;
}

if (isError) {
if (!authenticator || isError) {
return <LoadingError onRetry={refetch} />;
}

if (!authenticator) {
return null;
}

return (
<SentryDocumentTitle title={PAGE_TITLE}>
<SettingsPageHeader
Expand Down

0 comments on commit 4d9ba3d

Please sign in to comment.