Page MenuHomePhabricator

[web] Move `changeQueued` up from `ThreadSettingsModal` to `ConnectedThreadSettingsModal`
ClosedPublic

Authored by atul on Apr 18 2022, 1:41 PM.
Tags
None
Referenced Files
F3376769: D3763.id11730.diff
Wed, Nov 27, 2:05 AM
F3376310: D3763.diff
Tue, Nov 26, 11:17 PM
Unknown Object (File)
Sat, Nov 23, 9:53 AM
Unknown Object (File)
Sat, Nov 23, 9:44 AM
Unknown Object (File)
Sat, Nov 23, 9:39 AM
Unknown Object (File)
Sat, Nov 23, 9:25 AM
Unknown Object (File)
Tue, Nov 19, 2:59 AM
Unknown Object (File)
Thu, Nov 7, 8:35 PM

Details

Summary

Move changeQueued out from inner class component to outer "Connected" functional component.

(Also refactored the logic to simplify things/avoid lodash)

As part of the work to refactor ThreadSettingsModal... specifically to turn it into a functional component


Depends on D3762

Test Plan
  1. Made changes in ThreadSettingsModal
  2. Logged value of changeQueued and made sure it was as expected

Diff Detail

Repository
rCOMM Comm
Branch
master
Lint
No Lint Coverage
Unit
No Test Coverage

Event Timeline

web/modals/threads/thread-settings-modal.react.js
438–442

Experimented to make sure that this logic works as expected.

f959.png (246×1 px, 55 KB)

Adding @ashoat as first pass reviewer since he initially wrote the logic I refactored

atul requested review of this revision.Apr 18 2022, 1:52 PM

further simplify changeQueued logic with .values

val => v... looks better?

I don't recall anything about this logic. Feel free to add me back if you think there is some unique insight I am able to provide

tomek added inline comments.
web/modals/threads/thread-settings-modal.react.js
447–448 ↗(On Diff #11644)

A combination of filter and length > 0 can be expressed by using some. At this point we could even use something like .some(Boolean) but it is not that maintainable - introducing a change that sets a boolean might cause a hard to catch bug.

This revision is now accepted and ready to land.Apr 21 2022, 2:52 AM

rebase before addressing feedback

web/modals/threads/thread-settings-modal.react.js
447–448 ↗(On Diff #11644)

Oh nice, didn't know about some, looks cleaner