Keep user statuses for current channel and all post visibilities (#1080)
This commit is contained in:
parent
2641ec96fb
commit
da461ca35d
1 changed files with 15 additions and 1 deletions
|
|
@ -205,12 +205,26 @@ function cleanupState(action, keepCurrent = false) {
|
|||
}
|
||||
},
|
||||
views: {
|
||||
...resetPayload.views
|
||||
...resetPayload.views,
|
||||
channel: {
|
||||
...resetPayload.views.channel,
|
||||
|
||||
// on data cleanup we need to keep the postVisibility
|
||||
postVisibility: payload.views.channel.postVisibility
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
if (keepCurrent) {
|
||||
nextState.errors = payload.errors;
|
||||
|
||||
// keep the statuses for users in the current channel
|
||||
const profileIdsInCurrentChannel = payload.entities.users.profilesInChannel[currentChannelId];
|
||||
const nextStatuses = {};
|
||||
for (const id of profileIdsInCurrentChannel) {
|
||||
nextStatuses[id] = statuses[id];
|
||||
}
|
||||
nextState.entities.users.statuses = nextStatuses;
|
||||
}
|
||||
|
||||
return {
|
||||
|
|
|
|||
Loading…
Reference in a new issue