Этот коммит содержится в:
Konstantinos Pittas
2023-03-31 00:11:26 +03:00
коммит произвёл GitHub
родитель 11002c9863
Коммит 3938717f60

Просмотреть файл

@@ -388,7 +388,7 @@ export function makeGetPostsForThread(): (state: GlobalState, rootId: string) =>
);
}
// The selector below filters current user if it exists. Excluding currentUser is just for convinience
// The selector below filters current user if it exists. Excluding currentUser is just for convenience
export function makeGetProfilesForThread(): (state: GlobalState, rootId: string) => UserProfile[] {
const getPostsForThread = makeGetPostsForThread();
return createSelector(
@@ -398,7 +398,7 @@ export function makeGetProfilesForThread(): (state: GlobalState, rootId: string)
getPostsForThread,
getUserStatuses,
(allUsers, currentUserId, posts, userStatuses) => {
const profileIds = posts.map((post) => post.user_id);
const profileIds = posts.map((post) => post.user_id).filter(Boolean);
const uniqueIds = [...new Set(profileIds)];
return uniqueIds.reduce((acc: UserProfile[], id: string) => {
const profile: UserProfile = userStatuses ? {...allUsers[id], status: userStatuses[id]} : {...allUsers[id]};