diff --git a/src/hooks/usePrivatePersonalDetails.js b/src/hooks/usePrivatePersonalDetails.js index 37eb63dcd0fd..14c1e42e629a 100644 --- a/src/hooks/usePrivatePersonalDetails.js +++ b/src/hooks/usePrivatePersonalDetails.js @@ -1,4 +1,5 @@ import {useEffect, useContext} from 'react'; +import _ from 'underscore'; import * as PersonalDetails from '../libs/actions/PersonalDetails'; import {NetworkContext} from '../components/OnyxProvider'; @@ -9,7 +10,8 @@ export default function usePrivatePersonalDetails() { const {isOffline} = useContext(NetworkContext); useEffect(() => { - if (isOffline || Boolean(PersonalDetails.getPrivatePersonalDetails())) { + const personalDetails = PersonalDetails.getPrivatePersonalDetails(); + if (isOffline || (Boolean(personalDetails) && !_.isUndefined(personalDetails.isLoading))) { return; } PersonalDetails.openPersonalDetailsPage();