Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3356697
D13198.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Referenced Files
None
Subscribers
None
D13198.diff
View Options
diff --git a/native/chat/settings/add-users-modal.react.js b/native/chat/settings/add-users-modal.react.js
--- a/native/chat/settings/add-users-modal.react.js
+++ b/native/chat/settings/add-users-modal.react.js
@@ -11,9 +11,11 @@
import { createLoadingStatusSelector } from 'lib/selectors/loading-selectors.js';
import { threadInfoSelector } from 'lib/selectors/thread-selectors.js';
import { userInfoSelectorForPotentialMembers } from 'lib/selectors/user-selectors.js';
+import { useAddDMThreadMembers } from 'lib/shared/dm-ops/dm-op-utils.js';
import { usePotentialMemberItems } from 'lib/shared/search-utils.js';
import { threadActualMembers } from 'lib/shared/thread-utils.js';
import type { ThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js';
+import { threadTypeIsThick } from 'lib/types/thread-types-enum.js';
import { type AccountUserInfo } from 'lib/types/user-types.js';
import { useDispatchActionPromise } from 'lib/utils/redux-promise-utils.js';
@@ -102,15 +104,29 @@
const inputLength = userInfoInputArray.length;
const dispatchActionPromise = useDispatchActionPromise();
const userInfoInputArrayEmpty = inputLength === 0;
+ const addDMThreadMembers = useAddDMThreadMembers();
+
const onPressAdd = React.useCallback(() => {
if (userInfoInputArrayEmpty) {
return;
}
- void dispatchActionPromise(
- changeThreadSettingsActionTypes,
- addUsersToThread(),
- );
- }, [userInfoInputArrayEmpty, dispatchActionPromise, addUsersToThread]);
+
+ if (threadTypeIsThick(threadInfo.type)) {
+ void addDMThreadMembers(userInfoInputIDs, threadInfo);
+ } else {
+ void dispatchActionPromise(
+ changeThreadSettingsActionTypes,
+ addUsersToThread(),
+ );
+ }
+ }, [
+ userInfoInputArrayEmpty,
+ threadInfo,
+ dispatchActionPromise,
+ addUsersToThread,
+ addDMThreadMembers,
+ userInfoInputIDs,
+ ]);
const changeThreadSettingsLoadingStatus = useSelector(
createLoadingStatusSelector(changeThreadSettingsActionTypes),
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Nov 24, 8:04 PM (20 h, 5 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2577200
Default Alt Text
D13198.diff (2 KB)
Attached To
Mode
D13198: [native] implement adding thread members in `AddUsersModal`
Attached
Detach File
Event Timeline
Log In to Comment