Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3357043
D13198.id43767.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.id43767.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, 10:01 PM (20 h, 7 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2577200
Default Alt Text
D13198.id43767.diff (2 KB)
Attached To
Mode
D13198: [native] implement adding thread members in `AddUsersModal`
Attached
Detach File
Event Timeline
Log In to Comment