MM-34069 include current user in return values from getProfile* actions (#5308)

This commit is contained in:
Elias Nahum 2021-04-29 16:21:45 -04:00 committed by GitHub
parent f3b7c3a978
commit f14d4ee70f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -242,7 +242,6 @@ export function getProfiles(page = 0, perPage: number = General.PROFILE_CHUNK_SI
try {
profiles = await Client4.getProfiles(page, perPage, options);
removeUserFromList(currentUserId, profiles);
} catch (error) {
forceLogoutIfNecessary(error, dispatch, getState);
dispatch(logError(error));
@ -251,7 +250,7 @@ export function getProfiles(page = 0, perPage: number = General.PROFILE_CHUNK_SI
dispatch({
type: UserTypes.RECEIVED_PROFILES_LIST,
data: profiles,
data: removeUserFromList(currentUserId, [...profiles]),
});
return {data: profiles};
@ -307,7 +306,6 @@ export function getProfilesByIds(userIds: Array<string>, options?: any): ActionF
try {
profiles = await Client4.getProfilesByIds(userIds, options);
removeUserFromList(currentUserId, profiles);
} catch (error) {
forceLogoutIfNecessary(error, dispatch, getState);
dispatch(logError(error));
@ -316,7 +314,7 @@ export function getProfilesByIds(userIds: Array<string>, options?: any): ActionF
dispatch({
type: UserTypes.RECEIVED_PROFILES_LIST,
data: profiles,
data: removeUserFromList(currentUserId, [...profiles]),
});
return {data: profiles};
@ -330,7 +328,6 @@ export function getProfilesByUsernames(usernames: Array<string>): ActionFunc {
try {
profiles = await Client4.getProfilesByUsernames(usernames);
removeUserFromList(currentUserId, profiles);
} catch (error) {
forceLogoutIfNecessary(error, dispatch, getState);
dispatch(logError(error));
@ -339,7 +336,7 @@ export function getProfilesByUsernames(usernames: Array<string>): ActionFunc {
dispatch({
type: UserTypes.RECEIVED_PROFILES_LIST,
data: profiles,
data: removeUserFromList(currentUserId, [...profiles]),
});
return {data: profiles};