Page MenuHomePhorge

D11787.1767462749.diff
No OneTemporary

Size
1 KB
Referenced Files
None
Subscribers
None

D11787.1767462749.diff

diff --git a/native/components/community-actions-button.react.js b/native/components/community-actions-button.react.js
--- a/native/components/community-actions-button.react.js
+++ b/native/components/community-actions-button.react.js
@@ -7,7 +7,7 @@
import { useSafeAreaInsets } from 'react-native-safe-area-context';
import { primaryInviteLinksSelector } from 'lib/selectors/invite-links-selectors.js';
-import { threadHasPermission } from 'lib/shared/thread-utils.js';
+import { useThreadHasPermission } from 'lib/shared/thread-utils.js';
import type { ThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js';
import { threadPermissions } from 'lib/types/thread-permission-types.js';
import { threadTypes } from 'lib/types/thread-types-enum.js';
@@ -82,6 +82,15 @@
const activeTheme = useSelector(state => state.globalThemeInfo.activeTheme);
const styles = useStyles(unboundStyles);
+ const canManageLinks = useThreadHasPermission(
+ community,
+ threadPermissions.MANAGE_INVITE_LINKS,
+ );
+ const canChangeRoles = useThreadHasPermission(
+ community,
+ threadPermissions.CHANGE_ROLE,
+ );
+
const { showActionSheetWithOptions } = useActionSheet();
const actions = React.useMemo(() => {
if (!community) {
@@ -89,10 +98,6 @@
}
const result = [];
- const canManageLinks = threadHasPermission(
- community,
- threadPermissions.MANAGE_INVITE_LINKS,
- );
if (canManageLinks) {
result.push({
label: 'Manage invite links',
@@ -107,10 +112,6 @@
});
}
- const canChangeRoles = threadHasPermission(
- community,
- threadPermissions.CHANGE_ROLE,
- );
if (canChangeRoles) {
result.push({
label: 'Manage roles',
@@ -136,7 +137,9 @@
return null;
}, [
community,
+ canManageLinks,
inviteLink,
+ canChangeRoles,
fid,
navigateToManagePublicLinkView,
navigateToInviteLinksView,

File Metadata

Mime Type
text/plain
Expires
Sat, Jan 3, 5:52 PM (16 h, 53 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
5890041
Default Alt Text
D11787.1767462749.diff (1 KB)

Event Timeline