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 @@ -19,7 +19,6 @@ } from '../actions/message-actions.js'; import type { RemoveUsersFromThreadInput } from '../actions/thread-actions'; import { - changeThreadMemberRolesActionTypes, newThreadActionTypes, removeUsersFromThreadActionTypes, } from '../actions/thread-actions.js'; @@ -1531,38 +1530,6 @@ ); } -function switchMemberAdminRoleInThread( - threadInfo: ThreadInfo, - memberInfo: RelativeMemberInfo, - isCurrentlyAdmin: boolean, - dispatchActionPromise: DispatchActionPromise, - changeUserRoleServerCall: ( - threadID: string, - memberIDs: $ReadOnlyArray, - newRole: string, - ) => Promise, -) { - let newRole = null; - for (const roleID in threadInfo.roles) { - const role = threadInfo.roles[roleID]; - if (isCurrentlyAdmin && role.isDefault) { - newRole = role.id; - break; - } else if (!isCurrentlyAdmin && roleIsAdminRole(role)) { - newRole = role.id; - break; - } - } - invariant(newRole !== null, 'Could not find new role'); - - const customKeyName = `${changeThreadMemberRolesActionTypes.started}:${memberInfo.id}`; - dispatchActionPromise( - changeThreadMemberRolesActionTypes, - changeUserRoleServerCall(threadInfo.id, [memberInfo.id], newRole), - { customKeyName }, - ); -} - function getAvailableThreadMemberActions( memberInfo: RelativeMemberInfo, threadInfo: ThreadInfo, @@ -1845,7 +1812,6 @@ getThreadListSearchResults, useThreadListSearch, removeMemberFromThread, - switchMemberAdminRoleInThread, getAvailableThreadMemberActions, threadMembersWithoutAddedAshoat, patchThreadInfoToIncludeMentionedMembersOfParent,