Revert "Fix dialog state handling."

This reverts commit ec0e71bbe97707100c7b2a6dfe4b78ad43a72514.