Merge branch 'IDTEAM-1.26.0' into 'main'
[ProtonMail-WebClient.git] / packages / shared / lib / helpers / securityCheckup.ts
blob5fb234151f58e4b1ccb759eaf8cca12804200cf4
1 import type SecurityState from '../interfaces/securityCheckup/SecurityState';
3 export const getIsPerfectPhraseState = ({ phrase }: SecurityState) => phrase.isAvailable && phrase.isSet;
5 export const getIsPerfectEmailState = ({ email }: SecurityState) => email.isEnabled && !!email.value && email.verified;
6 export const getIsAlmostPerfectEmailState = ({ email }: SecurityState) =>
7     !!email.value && ((email.isEnabled && !email.verified) || (!email.isEnabled && email.verified));
9 export const getIsPerfectPhoneState = ({ phone }: SecurityState) => phone.isEnabled && !!phone.value && phone.verified;
10 export const getIsAlmostPerfectPhoneState = ({ phone }: SecurityState) =>
11     !!phone.value && ((phone.isEnabled && !phone.verified) || (!phone.isEnabled && phone.verified));
13 export const getIsPerfectDeviceRecoveryState = ({ deviceRecovery }: SecurityState) =>
14     deviceRecovery.isAvailable && deviceRecovery.isEnabled;