Promise resolution after close animation

This change moves the result promise resolution to after the close animation is finished.

This is to solve the issue where the result promise is currently getting resolved before the animation completes.  If you display a message box in the promise handler, it is displaying before the modal closes.