This refactoring shouldn't affect the logic. The purpose is to simplify the code so that we reset the state in a single place - it makes the following diff easier to understand.
https://linear.app/comm/issue/ENG-7075/clear-redux-state-only-when-current-user-id-changes