Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3311504
D13543.id44724.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
D13543.id44724.diff
View Options
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
Details
Attached
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)
Attached To
Mode
D13543: [native][web] Only show viewer in chat composer results when empty
Attached
Detach File
Event Timeline
Log In to Comment