-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
Update dynamically attachment modal #22543
Merged
Merged
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
f83a9b3
update attachment modal dynamically
dukenv0307 4dd20d4
refactor condition
dukenv0307 0aa8469
fix/21334
dukenv0307 32c3eb7
Merge branch 'main' into fix/21334
dukenv0307 10517e8
fix bug
dukenv0307 1e58e5b
format code
dukenv0307 a25661f
Merge branch 'main' into fix/21334
dukenv0307 ee6af34
fix lint
dukenv0307 402f106
return when dissmiss the modal
dukenv0307 0109bb3
fix prettier
dukenv0307 acf0547
aviod animated in native when dynamic update
dukenv0307 cda6d8d
remove comment line
dukenv0307 570047c
merge main
dukenv0307 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Do we need to
return
after this so thatprops.onNavigate
doesn't still get called?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.
@Beamanator When we create the PR, this component is a class component and I added return here. And then after it is changed to a function component, I resolve conflict, and if we return here the function doesn't return the state and the app also crashes, So I think we should the check to prevent call
props.onNavigate
or check inprops.onNavigate
function to do nothing if the attachment is empty.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.
Ya looks like this is causing this regression: #23964
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.
@Beamanator Do I need to create a PR to quickly fix it?
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.
@dukenv0307 interesting - I did this and it seemed to work fine for me: #23988
So I returned an object, not
undefined
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.
Thanks for offering creating a PR, but I already created one 😅 ^ feel free to review if you'd like
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.
That looks good to me.
Thank you.
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.
Hey @Beamanator and @dukenv0307,
I've noticed we've opted to remove the error throw in this section. While I understand this might be an attempt to address the issue of deleting an image, we need to recall that it was previously flagged as a bug when the carousel closed upon an image deletion (Issue #18451). Reintroducing this behavior might not be the best move.
The original intent of the
createInitialState
—as the name suggests—was to execute just once upon the carousel's opening. Its purpose was to display the "Ooops" screen if a user tries to open an unlocatable attachment. In my opinion, presenting this error screen offers a more insightful user experience compared to abruptly closing the modal, which may come off as if the user's action was disregarded.Can we reconsider this change and perhaps retain the error throw?