-
Notifications
You must be signed in to change notification settings - Fork 3.5k
fix just display track expense of selfDM is loaded #40409
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -259,6 +259,8 @@ function FloatingActionButtonAndPopover( | |
| showCreateMenu(); | ||
| } | ||
| }; | ||
| // eslint-disable-next-line react-hooks/exhaustive-deps | ||
| const selfDMReportID = useMemo(() => ReportUtils.findSelfDMReportID(), [isLoading]); | ||
|
|
||
| return ( | ||
| <View style={styles.flexGrow1}> | ||
|
|
@@ -274,7 +276,7 @@ function FloatingActionButtonAndPopover( | |
| text: translate('sidebarScreen.fabNewChat'), | ||
| onSelected: () => interceptAnonymousUser(Report.startNewChat), | ||
| }, | ||
| ...(canUseTrackExpense | ||
| ...(canUseTrackExpense && selfDMReportID | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not sure how did you record the video in the checklist author but this line completely broke the current logic, it will make the
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. tbh, I prefer disable that button while report is loading, because even when you can go to next page when report is loading, you still can't get the personal detail 🤔 , yeah I'm talking about
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Screen.Recording.2024-04-19.at.08.16.46.mov
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
You mean in case the selfDMReportID is undefined, the Track expense button will disappear, right?
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. OK, I see the problem now. For some accounts, ie my high traffic account,
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Related slack thread: GH:
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah there definitely is a BE component to it - however I think we should also handle it better in the FE. I like the idea of hiding the option
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ok cool. I'll complete the checklist then |
||
| ? [ | ||
| { | ||
| icon: Expensicons.DocumentPlus, | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This useMemo cause the issue I mentioned.selfDMReportIDhere 's always undefined, even I logout 🤔There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you test the PR with high traffic account? @nkdengineer
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just tested with the account I used to test other issues. What is the high-traffic account?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ideally, you should test your PR with a high traffic account, it's account with ton of reports, check it out here:
https://github.com/Expensify/App/blob/68e69623a8bca0dce5f384fa351d5cbb2214aeb4/contributingGuides/CONTRIBUTING.md#high-traffic-accounts
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@hungvu193 I just tested it in high traffic account and it works well