diff --git a/lib/shared/thread-utils.js b/lib/shared/thread-utils.js
--- a/lib/shared/thread-utils.js
+++ b/lib/shared/thread-utils.js
@@ -1517,7 +1517,7 @@
memberInfo: RelativeMemberInfo,
threadInfo: ThreadInfo,
canEdit: ?boolean = true,
-): $ReadOnlyArray<'remove_user' | 'remove_admin' | 'make_admin'> {
+): $ReadOnlyArray<'change_role' | 'remove_user'> {
const role = memberInfo.role;
if (!canEdit || !role) {
return [];
@@ -1533,6 +1533,11 @@
);
const result = [];
+
+ if (canChangeRoles && memberInfo.username && threadHasAdminRole(threadInfo)) {
+ result.push('change_role');
+ }
+
if (
canRemoveMembers &&
!memberInfo.isViewer &&
@@ -1541,12 +1546,6 @@
result.push('remove_user');
}
- if (canChangeRoles && memberInfo.username && threadHasAdminRole(threadInfo)) {
- result.push(
- memberIsAdmin(memberInfo, threadInfo) ? 'remove_admin' : 'make_admin',
- );
- }
-
return result;
}
diff --git a/web/modals/threads/members/member.react.js b/web/modals/threads/members/member.react.js
--- a/web/modals/threads/members/member.react.js
+++ b/web/modals/threads/members/member.react.js
@@ -3,15 +3,10 @@
import classNames from 'classnames';
import * as React from 'react';
-import {
- removeUsersFromThread,
- changeThreadMemberRoles,
-} from 'lib/actions/thread-actions.js';
+import { removeUsersFromThread } from 'lib/actions/thread-actions.js';
import SWMansionIcon from 'lib/components/SWMansionIcon.react.js';
import {
- memberIsAdmin,
removeMemberFromThread,
- switchMemberAdminRoleInThread,
getAvailableThreadMemberActions,
} from 'lib/shared/thread-utils.js';
import { stringForUser } from 'lib/shared/user-utils.js';
@@ -69,47 +64,18 @@
[boundRemoveUsersFromThread, dispatchActionPromise, memberInfo, threadInfo],
);
- const isCurrentlyAdmin = memberIsAdmin(memberInfo, threadInfo);
- const boundChangeThreadMemberRoles = useServerCall(changeThreadMemberRoles);
-
- const onMemberAdminRoleToggled = React.useCallback(
- () =>
- switchMemberAdminRoleInThread(
- threadInfo,
- memberInfo,
- isCurrentlyAdmin,
- dispatchActionPromise,
- boundChangeThreadMemberRoles,
- ),
- [
- boundChangeThreadMemberRoles,
- dispatchActionPromise,
- isCurrentlyAdmin,
- memberInfo,
- threadInfo,
- ],
- );
+ const onClickChangeRole = React.useCallback(() => {}, []);
const menuItems = React.useMemo(
() =>
getAvailableThreadMemberActions(memberInfo, threadInfo).map(action => {
- if (action === 'remove_admin') {
- return (
-
- );
- }
- if (action === 'make_admin') {
+ if (action === 'change_role') {
return (
);
}
@@ -117,7 +83,7 @@
return (