Page MenuHomePhabricator

[web] Add to reducer logic handling community id picked in chat
ClosedPublic

Authored by inka on Mar 7 2023, 3:02 AM.
Tags
None
Referenced Files
F3561519: D6969.id23482.diff
Fri, Dec 27, 9:00 AM
Unknown Object (File)
Fri, Nov 29, 8:57 AM
Unknown Object (File)
Fri, Nov 29, 8:56 AM
Unknown Object (File)
Nov 25 2024, 8:48 PM
Unknown Object (File)
Nov 25 2024, 8:24 PM
Unknown Object (File)
Nov 25 2024, 2:20 AM
Unknown Object (File)
Nov 19 2024, 7:44 AM
Unknown Object (File)
Nov 19 2024, 7:44 AM
Subscribers

Details

Summary

In revious diff (D6968) I added to redux state information about the community selected in the Chat tab. This diff adds logic that handles that filed in the reducer, and actions that can be
performed on it. we need to be albe to set the id, and clear it.
issue: https://linear.app/comm/issue/ENG-3176/make-pressing-a-drawer-item-in-chat-tab-filter-available-chats

Test Plan

Dispatched the new actions programatically, and checked that the redux state changes as planned.

Diff Detail

Repository
rCOMM Comm
Lint
No Lint Coverage
Unit
No Test Coverage

Event Timeline

inka requested review of this revision.Mar 7 2023, 3:17 AM
web/redux/redux-setup.js
201

Maybe it's high time to create a separate reducer for picking communities, don't you think?

It'll make this reducer more readable and logically separate this and other stuff like consts from action-types.js?

web/redux/redux-setup.js
201

I agree, we should avoid putting complex reducer functionality in the main file... can you create a new diff (above this one in the stack) that moves the existing functionality to a new file in web/redux/, and then update this diff so that it's updating that file?

tomek requested changes to this revision.Mar 31 2023, 5:33 AM

Requesting changes because we should refactor the code

This revision now requires changes to proceed.Mar 31 2023, 5:33 AM

Move code to dedicated reducer

This revision is now accepted and ready to land.Apr 11 2023, 2:00 AM