Starting promises api for dialog.open() and dialog.close()