-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Fix crash while changing contact method #19941
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 |
|---|---|---|
|
|
@@ -906,7 +906,8 @@ class ReportActionCompose extends React.Component { | |
| const reportParticipants = _.without(lodashGet(this.props.report, 'participants', []), this.props.currentUserPersonalDetails.login); | ||
| const participantsWithoutExpensifyEmails = _.difference(reportParticipants, CONST.EXPENSIFY_EMAILS); | ||
| const reportRecipient = this.props.personalDetails[participantsWithoutExpensifyEmails[0]]; | ||
| const shouldShowReportRecipientLocalTime = ReportUtils.canShowReportRecipientLocalTime(this.props.personalDetails, this.props.report) && !this.props.isComposerFullSize; | ||
| const shouldShowReportRecipientLocalTime = | ||
| ReportUtils.canShowReportRecipientLocalTime(this.props.personalDetails, this.props.report, this.props.currentUserPersonalDetails.login) && !this.props.isComposerFullSize; | ||
|
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. @hungvu193 Please verify if
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. Nice catch, I should notice this earlier. |
||
|
|
||
| // Prevents focusing and showing the keyboard while the drawer is covering the chat. | ||
| const isComposeDisabled = this.props.isDrawerOpen && this.props.isSmallScreenWidth; | ||
|
|
||
|
hungvu193 marked this conversation as resolved.
|
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.
We should not be using the lodashGet here. participant prop is required here. So should never be rendering this component if participant is not present. In case, participant is undefined here, it mean the root cause is in upper tree not here.
cc: @NikkiWines
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 is just a safe guard. We've fixed the root cause as well.
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 safe guard promotes more bugs. No one should be able to use this component without passing the participation and error should be thrown to make it clear during development. This should be reverted.