Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3343484
D10159.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D10159.diff
View Options
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<string>,
- newRole: string,
- ) => Promise<ChangeThreadSettingsPayload>,
-) {
- 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,
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Nov 23, 2:55 AM (18 h, 10 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2567839
Default Alt Text
D10159.diff (1 KB)
Attached To
Mode
D10159: [lib] Get rid of switchMemberAdminRoleInThread
Attached
Detach File
Event Timeline
Log In to Comment