Fix normal Profile Page displayed for invalid accountID#42769
Conversation
|
this is how it was working before my PR: https://github.com/Expensify/App/pull/41846/files#diff-9ec781fc7bf783309e61fa0ee95b25697a7d9aae9de9564e1a09055c4f65b3cbL120 I tried to re-create similar logic but I don't want to base it on existence of |
|
|
||
| const hasAvatar = Boolean(details.avatar); | ||
| const isLoading = Boolean(personalDetailsMetadata?.[accountID]?.isLoading) || isEmptyObject(details); | ||
| const shouldShowBlockingView = !isValidAccountId && !isLoading; |
There was a problem hiding this comment.
| const shouldShowBlockingView = !isValidAccountId && !isLoading; | |
| const shouldShowBlockingView = (!isValidAccountId && !isLoading) || CONST.RESTRICTED_ACCOUNT_IDS.includes(accountID); |
NAB
Reviewer Checklist
Screenshots/VideosAndroid: mWeb ChromeNetworking issue MacOS: DesktopCan't test due to a bug https://expensify.slack.com/archives/C01GTK53T8Q/p1717012386285909 |
| const accountID = Number(route.params?.accountID ?? 0); | ||
| const isCurrentUser = session?.accountID === accountID; | ||
| const details: PersonalDetails | EmptyObject = personalDetails?.[accountID] ?? (ValidationUtils.isValidAccountRoute(accountID) ? {} : {accountID: 0}); | ||
| const isValidAccountId = ValidationUtils.isValidAccountRoute(accountID); |
There was a problem hiding this comment.
Naming styles
| const isValidAccountId = ValidationUtils.isValidAccountRoute(accountID); | |
| const isValidAccountID = ValidationUtils.isValidAccountRoute(accountID); |
|
|
||
| const hasAvatar = Boolean(details.avatar); | ||
| const isLoading = Boolean(personalDetailsMetadata?.[accountID]?.isLoading) || isEmptyObject(details); | ||
| const shouldShowBlockingView = !isValidAccountId && !isLoading; |
| return ( | ||
| <ScreenWrapper testID={ProfilePage.displayName}> | ||
| <FullPageNotFoundView shouldShow={CONST.RESTRICTED_ACCOUNT_IDS.includes(accountID)}> | ||
| <FullPageNotFoundView shouldShow={shouldShowBlockingView || CONST.RESTRICTED_ACCOUNT_IDS.includes(accountID)}> |
There was a problem hiding this comment.
- the other suggestion
| <FullPageNotFoundView shouldShow={shouldShowBlockingView || CONST.RESTRICTED_ACCOUNT_IDS.includes(accountID)}> | |
| <FullPageNotFoundView shouldShow={shouldShowBlockingView}> |
|
@mountiny suggestions implemented |
|
@mountiny Yes! Looks good to me 🚀 |
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🚀 Deployed to production by https://github.com/Julesssss in version: 1.4.79-11 🚀
|




Details
accountIDis not an actual account id but a string, we will display NotFound PageFixed Issues
$ #42750
PROPOSAL:
Tests
Offline tests
QA Steps
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)myBool && <MyComponent />.src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.ScrollViewcomponent to make it scrollable when more elements are added to the page.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari
rec-web-bugfix.mp4
MacOS: Desktop