Page MenuHomePhabricator

[web] Replace `threadHasPermission` with `useThreadHasPermission` in `ThreadSettings*`
Needs RevisionPublic

Authored by atul on Tue, Apr 23, 1:49 PM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, May 2, 11:24 AM
Unknown Object (File)
Thu, May 2, 12:42 AM
Unknown Object (File)
Mon, Apr 29, 1:37 AM
Unknown Object (File)
Sun, Apr 28, 4:17 PM
Unknown Object (File)
Sat, Apr 27, 11:10 AM
Unknown Object (File)
Tue, Apr 23, 8:58 PM
Unknown Object (File)
Tue, Apr 23, 8:57 PM
Unknown Object (File)
Tue, Apr 23, 8:55 PM
Subscribers

Details

Summary

Similar to D11752, but for ThreadSettingsGeneralTab and ThreadSettingsModal


Depends on D11752

Test Plan

flow + close reading.

Will test generally at end to make sure things work as expected. Don't think it's practical to manually test each of these trivial changes.

Diff Detail

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

Event Timeline

atul requested review of this revision.Tue, Apr 23, 2:05 PM
tomek requested changes to this revision.Wed, Apr 24, 4:51 AM
tomek added inline comments.
web/modals/threads/settings/thread-settings-general-tab.react.js
83–86

Nit: usually we're calling hooks without altering the returned value inline - the current approach makes it less obvious that this is a hook and not a plain function. (doesn't matter too much, though).

web/modals/threads/settings/thread-settings-modal.react.js
100–119

It looks like it could be more convenient to have a hook that returns a set with all the permissions. But I don't think it is worth changing at this point.

124

We're changing the logic here - instead of checking the permissions of the thread from the parameter, we're checking the one from the selector. Is it safe? If it is safe, do we still need thread parameter in this callback?

This revision now requires changes to proceed.Wed, Apr 24, 4:51 AM