Page MenuHomePhabricator

[lib/web] introduce useThreadSettingsNotifications
ClosedPublic

Authored by ginsu on Wed, Jul 3, 1:06 AM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Jul 3, 2:18 PM
Unknown Object (File)
Wed, Jul 3, 11:53 AM
Unknown Object (File)
Wed, Jul 3, 11:53 AM
Unknown Object (File)
Wed, Jul 3, 11:53 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
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

ginsu requested review of this revision.Wed, Jul 3, 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.Wed, Jul 3, 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.Wed, Jul 3, 3:13 PM
This revision was automatically updated to reflect the committed changes.