diff --git a/app/mm-redux/actions/users.ts b/app/mm-redux/actions/users.ts index ae89ba907..a795208ad 100644 --- a/app/mm-redux/actions/users.ts +++ b/app/mm-redux/actions/users.ts @@ -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, 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, 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): 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): ActionFunc { dispatch({ type: UserTypes.RECEIVED_PROFILES_LIST, - data: profiles, + data: removeUserFromList(currentUserId, [...profiles]), }); return {data: profiles};