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
Unknown Object (File)
Fri, Apr 19, 4:38 PM
Unknown Object (File)
Mon, Apr 8, 11:21 PM
Unknown Object (File)
Mon, Apr 8, 7:53 PM
Unknown Object (File)
Fri, Apr 5, 5:34 PM
Unknown Object (File)
Thu, Apr 4, 10:10 PM
Unknown Object (File)
Thu, Apr 4, 10:10 PM
Unknown Object (File)
Thu, Apr 4, 10:10 PM
Unknown Object (File)
Thu, Apr 4, 10:10 PM
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
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

inka requested review of this revision.Mar 7 2023, 3:17 AM
web/redux/redux-setup.js
201 ↗(On Diff #23482)

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 ↗(On Diff #23482)

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