Page MenuHomePhabricator

D13543.id44724.diff
No OneTemporary

D13543.id44724.diff

diff --git a/native/chat/message-list-container.react.js b/native/chat/message-list-container.react.js
--- a/native/chat/message-list-container.react.js
+++ b/native/chat/message-list-container.react.js
@@ -265,11 +265,20 @@
const serverSearchResults = useSearchUsers(usernameInputText);
const auxUserInfos = useSelector(state => state.auxUserStore.auxUserInfos);
+ const viewerID = useSelector(state => state.currentUserInfo?.id);
+ const excludeUserIDs = React.useMemo(
+ () => [
+ ...userInfoInputArray.map(userInfo => userInfo.id),
+ ...(viewerID && userInfoInputArray.length > 0 ? [viewerID] : []),
+ ],
+ [userInfoInputArray, viewerID],
+ );
+
const userSearchResults = usePotentialMemberItems({
text: usernameInputText,
userInfos: otherUserInfos,
auxUserInfos,
- excludeUserIDs: userInfoInputArray.map(userInfo => userInfo.id),
+ excludeUserIDs,
includeServerSearchUsers: serverSearchResults,
});
diff --git a/web/chat/chat-thread-composer.react.js b/web/chat/chat-thread-composer.react.js
--- a/web/chat/chat-thread-composer.react.js
+++ b/web/chat/chat-thread-composer.react.js
@@ -52,9 +52,16 @@
const dispatch = useDispatch();
- const userInfoInputIDs = React.useMemo(
- () => userInfoInputArray.map(userInfo => userInfo.id),
- [userInfoInputArray],
+ const loggedInUserInfo = useLoggedInUserInfo();
+ invariant(loggedInUserInfo, 'loggedInUserInfo should be set');
+ const viewerID = loggedInUserInfo.id;
+
+ const excludeUserIDs = React.useMemo(
+ () => [
+ ...userInfoInputArray.map(userInfo => userInfo.id),
+ ...(viewerID && userInfoInputArray.length > 0 ? [viewerID] : []),
+ ],
+ [userInfoInputArray, viewerID],
);
const searchResults = useSearchUsers(usernameInputText);
@@ -65,19 +72,17 @@
text: usernameInputText,
userInfos: otherUserInfos,
auxUserInfos,
- excludeUserIDs: userInfoInputIDs,
+ excludeUserIDs,
includeServerSearchUsers: searchResults,
});
const userListItemsWithENSNames = useENSNames(userListItems);
const { pushModal } = useModalContext();
- const loggedInUserInfo = useLoggedInUserInfo();
- invariant(loggedInUserInfo, 'loggedInUserInfo should be set');
const pendingPrivateThread = React.useRef(
createPendingThread({
- viewerID: loggedInUserInfo.id,
+ viewerID,
threadType: threadTypes.GENESIS_PRIVATE,
members: [loggedInUserInfo],
}),

File Metadata

Mime Type
text/plain
Expires
Wed, Nov 20, 9:12 AM (19 h, 20 s)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2543886
Default Alt Text
D13543.id44724.diff (2 KB)

Event Timeline