1 import { useAddresses } from '@proton/account/addresses/hooks';
2 import { useUser } from '@proton/account/user/hooks';
3 import { useUserKeys } from '@proton/account/userKeys/hooks';
4 import { getIsRecoveryFileAvailable } from '@proton/shared/lib/recoveryFile/recoveryFile';
6 import useConfig from '../useConfig';
8 const useIsRecoveryFileAvailable = () => {
9 const [user, loadingUser] = useUser();
10 const [addresses = [], loadingAddresses] = useAddresses();
11 const [userKeys = [], loadingUserKeys] = useUserKeys();
12 const { APP_NAME } = useConfig();
14 const isRecoveryFileAvailable = getIsRecoveryFileAvailable({
21 return [isRecoveryFileAvailable, loadingUserKeys || loadingAddresses || loadingUser] as const;
24 export default useIsRecoveryFileAvailable;