Skip to content

Commit

Permalink
fix: dont show headline if we dont have a thumbprint / certificateDet…
Browse files Browse the repository at this point in the history
…ails (#18435)
  • Loading branch information
aweiss-dev authored Dec 5, 2024
1 parent 2adab05 commit 50f9bce
Showing 1 changed file with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,17 @@ export const MLSDeviceDetails = ({isCurrentDevice, identity, isSelfUser = false}

const certificateState = identity?.status ?? MLSStatuses.NOT_ACTIVATED;
const isE2EIEnabled = E2EIHandler.getInstance().isE2EIEnabled();
const showE2EICertificateDetails =
isE2EIEnabled && (isSelfUser || (!isSelfUser && certificateState !== MLSStatuses.NOT_ACTIVATED));

if (!isSelfUser && certificateState === MLSStatuses.NOT_ACTIVATED) {
return null;
}

if (!showE2EICertificateDetails && !identity?.thumbprint) {
return null;
}

return (
<div css={styles.wrapper}>
<h4 className="paragraph-body-3">{t('mlsSignature', {signature: MLSPublicKeys.ED25519.toUpperCase()})}</h4>
Expand All @@ -59,9 +65,7 @@ export const MLSDeviceDetails = ({isCurrentDevice, identity, isSelfUser = false}
</>
)}

{isE2EIEnabled && (isSelfUser || (!isSelfUser && certificateState !== MLSStatuses.NOT_ACTIVATED)) && (
<E2EICertificateDetails identity={identity} isCurrentDevice={isCurrentDevice} />
)}
{showE2EICertificateDetails && <E2EICertificateDetails identity={identity} isCurrentDevice={isCurrentDevice} />}
</div>
);
};

0 comments on commit 50f9bce

Please sign in to comment.