Skip to content

Commit c07af88

Browse files
allgandalfmountiny
andauthored
Apply suggestions from code review
Co-authored-by: Vit Horacek <[email protected]>
1 parent e532ef1 commit c07af88

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

src/hooks/useIndicatorStatus.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ function useIndicatorStatus(): IndicatorStatusResult {
2828
const [userWallet] = useOnyx(ONYXKEYS.USER_WALLET);
2929
const [walletTerms] = useOnyx(ONYXKEYS.WALLET_TERMS);
3030
const [loginList] = useOnyx(ONYXKEYS.LOGIN_LIST);
31-
const [privatePersoanlDetails] = useOnyx(ONYXKEYS.PRIVATE_PERSONAL_DETAILS);
31+
const [privatePersonalDetails] = useOnyx(ONYXKEYS.PRIVATE_PERSONAL_DETAILS);
3232

3333
// If a policy was just deleted from Onyx, then Onyx will pass a null value to the props, and
3434
// those should be cleaned out before doing any error checking
@@ -58,7 +58,7 @@ function useIndicatorStatus(): IndicatorStatusResult {
5858
[CONST.INDICATOR_STATUS.HAS_LOGIN_LIST_ERROR]: !!loginList && UserUtils.hasLoginListError(loginList),
5959
// Wallet term errors that are not caused by an IOU (we show the red brick indicator for those in the LHN instead)
6060
[CONST.INDICATOR_STATUS.HAS_WALLET_TERMS_ERRORS]: Object.keys(walletTerms?.errors ?? {}).length > 0 && !walletTerms?.chatReportID,
61-
[CONST.INDICATOR_STATUS.HAS_PHONE_NUMBER_ERROR]: !!privatePersoanlDetails?.errorFields?.phoneNumber ?? undefined,
61+
[CONST.INDICATOR_STATUS.HAS_PHONE_NUMBER_ERROR]: !!privatePersonalDetails?.errorFields?.phoneNumber ?? undefined,
6262
};
6363

6464
const infoChecking: Partial<Record<IndicatorStatus, boolean>> = {

src/libs/UserUtils.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,8 @@ function getLoginListBrickRoadIndicator(loginList: OnyxEntry<LoginList>): LoginL
8686
* Gets the appropriate brick road indicator status for the Profile section.
8787
* Error status is higher priority, so we check for that first.
8888
*/
89-
function getProfilePageBrickRoadIndicator(loginList: OnyxEntry<LoginList>, privatePersoanlDetails: OnyxEntry<PrivatePersonalDetails>): LoginListIndicator {
90-
const hasPhoneNumberError = !!privatePersoanlDetails?.errorFields?.phoneNumber;
89+
function getProfilePageBrickRoadIndicator(loginList: OnyxEntry<LoginList>, privatePersonalDetails: OnyxEntry<PrivatePersonalDetails>): LoginListIndicator {
90+
const hasPhoneNumberError = !!privatePersonalDetails?.errorFields?.phoneNumber;
9191
if (hasLoginListError(loginList) || hasPhoneNumberError) {
9292
return CONST.BRICK_ROAD_INDICATOR_STATUS.ERROR;
9393
}

src/pages/settings/InitialSettingsPage.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ function InitialSettingsPage({currentUserPersonalDetails}: InitialSettingsPagePr
8080
const [walletTerms] = useOnyx(ONYXKEYS.WALLET_TERMS);
8181
const [loginList] = useOnyx(ONYXKEYS.LOGIN_LIST);
8282
const [policies] = useOnyx(ONYXKEYS.COLLECTION.POLICY);
83-
const [privatePersoanlDetails] = useOnyx(ONYXKEYS.PRIVATE_PERSONAL_DETAILS);
83+
const [privatePersonalDetails] = useOnyx(ONYXKEYS.PRIVATE_PERSONAL_DETAILS);
8484

8585
const network = useNetwork();
8686
const theme = useTheme();
@@ -127,7 +127,7 @@ function InitialSettingsPage({currentUserPersonalDetails}: InitialSettingsPagePr
127127
* @returns object with translationKey, style and items for the account section
128128
*/
129129
const accountMenuItemsData: Menu = useMemo(() => {
130-
const profileBrickRoadIndicator = UserUtils.getProfilePageBrickRoadIndicator(loginList, privatePersoanlDetails);
130+
const profileBrickRoadIndicator = UserUtils.getProfilePageBrickRoadIndicator(loginList, privatePersonalDetails);
131131
const paymentCardList = fundList;
132132
const defaultMenu: Menu = {
133133
sectionStyle: styles.accountSettingsSectionContainer,
@@ -162,7 +162,7 @@ function InitialSettingsPage({currentUserPersonalDetails}: InitialSettingsPagePr
162162
};
163163

164164
return defaultMenu;
165-
}, [loginList, fundList, styles.accountSettingsSectionContainer, bankAccountList, userWallet?.errors, walletTerms?.errors, privatePersoanlDetails]);
165+
}, [loginList, fundList, styles.accountSettingsSectionContainer, bankAccountList, userWallet?.errors, walletTerms?.errors, privatePersonalDetails]);
166166

167167
/**
168168
* Retuns a list of menu items data for workspace section

0 commit comments

Comments
 (0)