Closed mattlewis92 closed 7 years ago
This is probably a good idea insofar that it's coupled with cancelling uploads on close. We would have to update our docs to make it clear that the picker can now reject, since we don't want users getting unhandled rejection errors.
Alternatively you could have it opt in via a flag 🙂
I was considering it. Perhaps rejectOnCancel
or rejectOnClose
(assuming the close cancels in-flight requests)? Something like that. This might address https://github.com/filestack/filestack-js/issues/9. In this case the user can "cancel" by clicking the close button or hitting their escape key. In both of these cases we can offer the ability to reject the Promise returned by pick
.
0.8.0 now includes a rejectOnCancel
option.
Awesome, thanks! 😄
This is how v2 currently functions. To workaround this in v3 you have to wrap the call to pick in another promise and reject it when the onClose callback is called, which isn't a great developer experience.