Rc fixes #2085

Merged
neb-b merged 11 commits from rc-fixes into master 2018-11-02 19:33:01 +01:00
Showing only changes of commit 6e88160e04 - Show all commits

View file

@ -41,13 +41,18 @@ export default handleActions(
action: DoChannelUnsubscribe
): SubscriptionState => {
const subscriptionToRemove: Subscription = action.data;
const newSubscriptions = state.subscriptions
.slice()
.filter(subscription => subscription.channelName !== subscriptionToRemove.channelName);
// Check if we need to remove it from the 'unread' state
const { unread } = state.unread;
if (unread[subscriptionToRemove.uri]) {
delete unread[subscriptionToRemove.uri];
}
return {
...state,
...unread,
subscriptions: newSubscriptions,
};
},