Follow up of #7
A better way would be to refresh after successful command execution. This way we could automatically close the dialog and trigger refresh. In case command execution fails the dialog would stay open and no refresh is triggered.
Read the comments in the linked PR for inspiration!