Open nicroto opened 6 years ago
That's correct... Do you have any idea how this can be improved? I'm thinking of resolving the promise with a property that takes the value false
on rejection instead of rejecting the promise... Do let me know if you have a better idea.
Thanks
I think it's the correct way as it correspond to what the user did: say "false" to the question prompted.
What is the reason the promise rejects with false
? It seems to me that you'd reject a promise with either nothing or an error object. If it's not necessary, I'd suggest to remove the false
from the rejection so we don't get a warning about an unhandled promise rejection.
Especially when you use the dialog from an async function - you will have to make the call inside of a try-catch block or you get a false error within the console when you cancel the confirm operation (because of the unhandled reject call).