[web][native] Refactor reset state logic in reducers
Summary:
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
Test Plan: Checked if logging out clears the Redux state.
Reviewers: kamil, inka, varun
Reviewed By: inka
Subscribers: ashoat
Differential Revision: https://phab.comm.dev/D11532