Since this is a Command function, it has to return either a promise or nothing. So probably the right thing to do is return a promise, and pass the dialog when resolving it.