Revert "Fix dialog state handling."

This reverts commit fa2211a565a82d5ac2d7735f133223ad9b58b127.