Skip to content

Commit

Permalink
Merge pull request #27647 from mkhutornyi/fix-27560
Browse files Browse the repository at this point in the history
  • Loading branch information
thienlnam authored Sep 18, 2023
2 parents 099fac6 + 0ba2aba commit 2792030
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/hooks/usePrivatePersonalDetails.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import {useEffect, useContext} from 'react';
import _ from 'underscore';
import * as PersonalDetails from '../libs/actions/PersonalDetails';
import {NetworkContext} from '../components/OnyxProvider';

Expand All @@ -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();
Expand Down

0 comments on commit 2792030

Please sign in to comment.