Skip to content

Commit

Permalink
Merge pull request #27647 from mkhutornyi/fix-27560
Browse files Browse the repository at this point in the history
(cherry picked from commit 2792030)
  • Loading branch information
thienlnam authored and OSBotify committed Sep 18, 2023
1 parent 19e3048 commit 9058afb
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 9058afb

Please sign in to comment.