-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
Changes from 7 commits
84367a8
e204aab
c5f09fb
9591c83
9b164ae
005cc6c
022e526
239115f
b293467
a4a6569
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 |
---|---|---|
|
@@ -250,7 +250,7 @@ class AttachmentModal extends PureComponent { | |
} | ||
|
||
render() { | ||
const source = this.state.source; | ||
const source = this.props.source || this.state.source; | ||
return ( | ||
<> | ||
<Modal | ||
|
@@ -274,7 +274,7 @@ class AttachmentModal extends PureComponent { | |
title={this.props.headerTitle || this.props.translate('common.attachment')} | ||
shouldShowBorderBottom | ||
shouldShowDownloadButton={this.props.allowDownload} | ||
onDownloadButtonPress={() => this.downloadAttachment(source)} | ||
onDownloadButtonPress={() => this.downloadAttachment(this.state.source)} | ||
onCloseButtonPress={() => this.setState({isModalOpen: false})} | ||
/> | ||
<View style={styles.imageModalImageCenterContainer}> | ||
|
@@ -286,8 +286,7 @@ class AttachmentModal extends PureComponent { | |
onToggleKeyboard={this.updateConfirmButtonVisibility} | ||
/> | ||
) : ( | ||
Boolean(this.state.source) && | ||
this.state.shouldLoadAttachment && ( | ||
Boolean(source) && this.state.shouldLoadAttachment && ( | ||
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. why this is needed here ? 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. 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 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. Update: as we are using |
||
<AttachmentView | ||
containerStyles={[styles.mh5]} | ||
source={source} | ||
|
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.
source
from here was previously set tothis.state.source
and the download functionality was working properly. By updating this, after I was downloading an image, I couldn't open it locally because it was wrongly downloaded. Updated it back to fix this & updated the QA steps with this use case.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.
Can you elaborate more on the issue ? how is it "wrongly downloaded" ?
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.
Trying to open the file after downloading it shows me this:
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.
Ah I see it , the
downloadAttachment
require urls to be singed ( with auth signature ) , if url isn’t signed you can’t download them