Remove `setTimeout` usage in AttachmentPicker/index.native.js
See original GitHub issueIf you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!
Expected Result:
The Attachment Picker modal should work correctly without the need of setTimeout
Actual Result:
setTimeout
is needed because on iOS the Gallery/Camera is immediately dismissed when the Attachment bottom docked modal closes
Details
This is a follow up on https://github.com/Expensify/Expensify.cash/pull/2656#discussion_r624113073 It can potentially be resolved by updating the attachment related libraries handled in this ticket: #2531
Action Performed:
- Open a chat
- Select (+) button to add an attachment
- Select gallery
- Sometimes the gallery would open and immediately close or not open at all
Workaround:
Added a brief timeout so that the Camera/Gallery is only opened a 1-2 frames after the Attachment Picker modal closes
Platform:
Where is this issue occurring?
- Web
- ✅ iOS
- Android
- Desktop App
- Mobile Web
Version Number: 1.0.38-1 Logs: https://stackoverflow.com/c/expensify/questions/4856 Notes/Photos/Videos: Any additional supporting documentation Expensify/Expensify Issue URL:
Issue Analytics
- State:
- Created 2 years ago
- Comments:29 (23 by maintainers)
Top GitHub Comments
Yeah, let’s put this on HOLD until that library is updated. Good call.
Sorry but there’s some big misunderstanding here. There’s nothing that can be done for this ticket ATM. And there’s no bug that needs fixing - I was asked to open this task as a reminder to remove the
setTimeout
call at some point in the future when that’s possiblehttps://github.com/Expensify/Expensify.cash/pull/2656#discussion_r626854415
Currently it’s not possible it will lead to a bug preventing image picking I don’t see any way to address this right now. The best thing to do IMO is to wait the other ticket that updates the image picker library and see if the
setTimeout
can be removed then@Christinadobrzyn I can’t accept the Upwork invite as I don’t see a way to complete this task ATM