Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3311476
D13541.id44722.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
3 KB
Referenced Files
None
Subscribers
None
D13541.id44722.diff
View Options
diff --git a/web/chat/chat-message-list-container.react.js b/web/chat/chat-message-list-container.react.js
--- a/web/chat/chat-message-list-container.react.js
+++ b/web/chat/chat-message-list-container.react.js
@@ -28,8 +28,7 @@
function ChatMessageListContainer(props: Props): React.Node {
const { activeChatThreadID } = props;
- const { isChatCreation, selectedUserInfos, otherUserInfos } =
- useInfosForPendingThread();
+ const { isChatCreation, selectedUserInfos } = useInfosForPendingThread();
const threadInfo = useThreadInfoForPossiblyPendingThread(activeChatThreadID);
invariant(threadInfo, 'ThreadInfo should be set');
@@ -127,7 +126,6 @@
const chatUserSelection = (
<ChatThreadComposer
userInfoInputArray={selectedUserInfos}
- otherUserInfos={otherUserInfos}
threadID={threadInfo.id}
inputState={inputState}
/>
@@ -143,13 +141,7 @@
{messageListAndInput}
</>
);
- }, [
- inputState,
- isChatCreation,
- otherUserInfos,
- selectedUserInfos,
- threadInfo,
- ]);
+ }, [inputState, isChatCreation, selectedUserInfos, threadInfo]);
return connectDropTarget(
<div className={containerStyle} ref={containerRef}>
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
@@ -10,6 +10,7 @@
import { useLoggedInUserInfo } from 'lib/hooks/account-hooks.js';
import { useENSNames } from 'lib/hooks/ens-cache.js';
import { useUsersSupportThickThreads } from 'lib/hooks/user-identities-hooks.js';
+import { userInfoSelectorForPotentialMembers } from 'lib/selectors/user-selectors.js';
import {
usePotentialMemberItems,
useSearchUsers,
@@ -36,7 +37,6 @@
type Props = {
+userInfoInputArray: $ReadOnlyArray<AccountUserInfo>,
- +otherUserInfos: { [id: string]: AccountUserInfo },
+threadID: string,
+inputState: InputState,
};
@@ -46,7 +46,7 @@
| 'keep-active-thread';
function ChatThreadComposer(props: Props): React.Node {
- const { userInfoInputArray, otherUserInfos, threadID, inputState } = props;
+ const { userInfoInputArray, threadID, inputState } = props;
const [usernameInputText, setUsernameInputText] = React.useState('');
@@ -60,6 +60,7 @@
const searchResults = useSearchUsers(usernameInputText);
const auxUserInfos = useSelector(state => state.auxUserStore.auxUserInfos);
+ const otherUserInfos = useSelector(userInfoSelectorForPotentialMembers);
const userListItems = usePotentialMemberItems({
text: usernameInputText,
userInfos: otherUserInfos,
diff --git a/web/utils/thread-utils.js b/web/utils/thread-utils.js
--- a/web/utils/thread-utils.js
+++ b/web/utils/thread-utils.js
@@ -6,7 +6,6 @@
import { useLoggedInUserInfo } from 'lib/hooks/account-hooks.js';
import { useUsersSupportThickThreads } from 'lib/hooks/user-identities-hooks.js';
import { threadInfoSelector } from 'lib/selectors/thread-selectors.js';
-import { userInfoSelectorForPotentialMembers } from 'lib/selectors/user-selectors.js';
import {
createPendingThread,
useExistingThreadInfoFinder,
@@ -20,7 +19,6 @@
type InfosForPendingThread = {
+isChatCreation: boolean,
+selectedUserInfos: $ReadOnlyArray<AccountUserInfo>,
- +otherUserInfos: { [id: string]: AccountUserInfo },
};
function useInfosForPendingThread(): InfosForPendingThread {
@@ -30,11 +28,9 @@
const selectedUserInfos = useSelector(
state => state.navInfo.selectedUserList ?? [],
);
- const otherUserInfos = useSelector(userInfoSelectorForPotentialMembers);
return {
isChatCreation,
selectedUserInfos,
- otherUserInfos,
};
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Nov 20, 8:56 AM (21 h, 34 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2543865
Default Alt Text
D13541.id44722.diff (3 KB)
Attached To
Mode
D13541: [web] Only call userInfoSelectorForPotentialMembers where it's needed
Attached
Detach File
Event Timeline
Log In to Comment