Page MenuHomePhabricator

[lib/web] introduce useThreadSettingsNotifications
ClosedPublic

Authored by ginsu on Jul 3 2024, 1:06 AM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Nov 11, 3:17 AM
Unknown Object (File)
Sun, Nov 10, 9:32 PM
Unknown Object (File)
Sun, Nov 10, 8:44 PM
Unknown Object (File)
Sun, Nov 10, 1:06 PM
Unknown Object (File)
Fri, Nov 8, 10:39 PM
Unknown Object (File)
Fri, Nov 8, 7:14 AM
Unknown Object (File)
Thu, Oct 24, 5:13 AM
Unknown Object (File)
Fri, Oct 18, 8:17 AM
Subscribers

Details

Summary

This diff introduces a new hook called useThreadSettingsNotifications which factors out all the shared thread notification settings logic that will be used in both web and native

Test Plan

Confirmed that there were no regresssions with the notifications modal on web

Diff Detail

Repository
rCOMM Comm
Lint
No Lint Coverage
Unit
No Test Coverage

Event Timeline

ginsu requested review of this revision.Jul 3 2024, 1:22 AM
lib/shared/thread-settings-notifications-utils.js
64–74 ↗(On Diff #41929)

A subsequent diff will handle improving the error handling

inka added inline comments.
lib/shared/thread-settings-notifications-utils.js
28 ↗(On Diff #41929)

This name sounds like a function name, like this variable can be called to disable the save button. Can we call it saveButtonDisabled?

This revision is now accepted and ready to land.Jul 3 2024, 2:39 AM
ashoat added inline comments.
lib/shared/thread-settings-notifications-utils.js
82–85 ↗(On Diff #41929)

Thanks for adding loading state here

102–104 ↗(On Diff #41929)

Do we really need all three of these, versus just exposing setNotificationSettings, and letting the caller continue creating the callbacks?

lib/shared/thread-settings-notifications-utils.js
102–104 ↗(On Diff #41929)

I guess it's reused in D12647 and so we'd need to be creating the callbacks in two different places. Feel free to ignore this feedback

Removing this diff from the stack so I can land as is (locally rebased + confirmed that this is safe)

This revision was landed with ongoing or failed builds.Jul 3 2024, 3:13 PM
This revision was automatically updated to reflect the committed changes.