Skip to content
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

[FIX 17237] Updated usages of source. #19107

Merged
merged 10 commits into from
May 22, 2023
7 changes: 3 additions & 4 deletions src/components/AttachmentModal.js
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ class AttachmentModal extends PureComponent {
}

render() {
const source = this.state.source;
const source = this.props.source || this.state.source;
return (
<>
<Modal
Expand Down Expand Up @@ -282,12 +282,11 @@ class AttachmentModal extends PureComponent {
<AttachmentCarousel
reportID={this.props.reportID}
onNavigate={this.onNavigate}
source={this.props.source}
source={source}
onToggleKeyboard={this.updateConfirmButtonVisibility}
/>
) : (
Boolean(this.state.source) &&
this.state.shouldLoadAttachment && (
Boolean(source) && this.state.shouldLoadAttachment && (
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why this is needed here ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not needed, I was thinking to update the usage to source there and let this.state.shouldLoadAttachment be managed for uploading files. I may revert it back if you say so, maybe it's unnecessary. Let me know

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Update: as we are using source={source} 3 lines below in the AttachmentView which shows only if the previous conditions are true, I think it's ok to update it like this.

<AttachmentView
containerStyles={[styles.mh5]}
source={source}
Expand Down