Added attachment size check for videos on native#6588
Conversation
Beamanator
left a comment
There was a problem hiding this comment.
Looks great, tests well on native devices! 👍 Just one quick question
|
Also interested in your review @parasharrajat when you have time 👍 |
|
I will do that today. It's on my list. |
parasharrajat
left a comment
There was a problem hiding this comment.
There are a few suggestions otherwise looks good.
parasharrajat
left a comment
There was a problem hiding this comment.
NAB: But https://github.com/Expensify/App/pull/6588/files#R244 completeAttachmentSelection is very confusing.
This function should be just initialized on the constructor as noop.
this.completeAttachmentSelection = () => {}
parasharrajat
left a comment
There was a problem hiding this comment.
NAB: another very confusing code is isValidSize in AttachementModal.js
App/src/components/AttachmentModal.js
Lines 116 to 118 in 04d28af
it returns true when file is not present.
|
@parasharrajat @Beamanator I've updated PR as per comments. I am not sure about |
parasharrajat
left a comment
There was a problem hiding this comment.
Looks better but one more suggestion before I will test it on platforms.
OK. let's leave it then. In theory, the file will never be null for this function. |
parasharrajat
left a comment
There was a problem hiding this comment.
The code looks good now. Thanks for the changes. cc: @Beamanator
NAB: The only thing I found confusing is that the #6588 (files) completeAttachmentSelection is very confusing.
We should remove this function definition. It is never used. It also uses an unused state variable result which is not consumed anywhere. In action, completeAttachmentSelection is replaced on runtime at L256. I leave this up to you @Beamanator to decide.
/**
* Opens the attachment modal
*
* @param {function} onPicked A callback that will be called with the selected attachment
*/
open(onPicked) {
this.completeAttachmentSelection = onPicked;
this.setState({isVisible: true});
}|
|
||
| this.close = this.close.bind(this); | ||
| this.pickAttachment = this.pickAttachment.bind(this); | ||
| this.completeAttachmentSelection = () => {}; |
There was a problem hiding this comment.
I'd say we should not add this for now, but make a separate issue to clean up completeAttachmentSelection - as you said, it looks pretty horrible in this file, but that's not the point of this PR
There was a problem hiding this comment.
@akshayasalvi Could you please remove this line based on the request above?
Added Promise for jsdoc Co-authored-by: Alex Beaman <dabeamanator@gmail.com>
…p into attachment-size-err
|
@parasharrajat @Beamanator PR updated with the changes. Thanks for the feedback and helping improve the code. |
parasharrajat
left a comment
There was a problem hiding this comment.
I think you missed one pointer.
|
|
||
| this.close = this.close.bind(this); | ||
| this.pickAttachment = this.pickAttachment.bind(this); | ||
| this.completeAttachmentSelection = () => {}; |
There was a problem hiding this comment.
@akshayasalvi Could you please remove this line based on the request above?
|
@parasharrajat Done |
Beamanator
left a comment
There was a problem hiding this comment.
Awesome 👍 Nice work @akshayasalvi and thanks for the helpful reviews @parasharrajat 👍
|
✋ 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 staging by @Beamanator in version: 1.1.19-5 🚀
|
|
🚀 Deployed to production by @Julesssss in version: 1.1.21-1 🚀
|
Details
Fixed Issues
$ #5918
Tests
QA Steps
Tested On
Screenshots
Web
Mobile Web
Desktop
iOS
Android