Wait for the dialogs to close.