Skip to content

Commit

Permalink
remove dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
dukenv0307 committed Oct 3, 2023
1 parent 4f258f0 commit 41f726b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/pages/settings/Profile/PronounsPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ function PronounsPage({currentUserPersonalDetails, isLoadingApp}) {
const [searchValue, setSearchValue] = useState('');

useEffect(() => {
if (isLoadingApp && _.isEmpty(currentUserPersonalDetails.login)) {
if (isLoadingApp && _.isUndefined(currentUserPersonalDetails.pronouns)) {
return;
}
const currentPronounsText = _.chain(CONST.PRONOUNS_LIST)
Expand All @@ -46,9 +46,9 @@ function PronounsPage({currentUserPersonalDetails, isLoadingApp}) {

setSearchValue(currentPronounsText ? translate(`pronouns.${currentPronounsText}`) : '');

// Only need to add login to dependency because after the data is loaded, other fields are also exist
// Only need to update search value when the first time the data is loaded
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [currentUserPersonalDetails.login, isLoadingApp]);
}, [isLoadingApp]);

const filteredPronounsList = useMemo(() => {
const pronouns = _.chain(CONST.PRONOUNS_LIST)
Expand Down Expand Up @@ -85,7 +85,7 @@ function PronounsPage({currentUserPersonalDetails, isLoadingApp}) {
includeSafeAreaPaddingBottom={false}
testID={PronounsPage.displayName}
>
{isLoadingApp && _.isEmpty(currentUserPersonalDetails.login) ? (
{isLoadingApp && _.isUndefined(currentUserPersonalDetails.pronouns) ? (
<FullScreenLoadingIndicator />
) : (
<>
Expand Down

0 comments on commit 41f726b

Please sign in to comment.