(cherry picked from commit ccb098972994a8d85ba8cedca95436d19d9477e0) Co-authored-by: Devin Binnie <52460000+devinbinnie@users.noreply.github.com>
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
27fadafead
Коммит
f1f6719f38
@@ -2255,6 +2255,35 @@ describe('Selectors.Channels.getUnreadStatus', () => {
|
||||
|
||||
expect(Selectors.getUnreadStatus(newState)).toBe(1);
|
||||
});
|
||||
|
||||
it('should not count unreads and mentions from a muted channel', () => {
|
||||
const mutedChannelId = channel2.id;
|
||||
const newMyMembers = {
|
||||
...testState.entities.channels.myMembers,
|
||||
[mutedChannelId]: {
|
||||
...testState.entities.channels.myMembers[mutedChannelId],
|
||||
notify_props: {
|
||||
...testState.entities.channels.myMembers[mutedChannelId].notify_props,
|
||||
mark_unread: 'mention',
|
||||
},
|
||||
mention_count: 3,
|
||||
msg_count: 10,
|
||||
},
|
||||
};
|
||||
|
||||
const newState = {
|
||||
...testState,
|
||||
entities: {
|
||||
...testState.entities,
|
||||
channels: {
|
||||
...testState.entities.channels,
|
||||
myMembers: newMyMembers,
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
expect(Selectors.getUnreadStatus(newState)).toBe(1);
|
||||
});
|
||||
});
|
||||
|
||||
describe('Selectors.Channels.getUnreadStatus', () => {
|
||||
|
||||
@@ -642,8 +642,12 @@ export const getUnreadStatus: (state: GlobalState) => BasicUnreadStatus = create
|
||||
return counts;
|
||||
}
|
||||
|
||||
if (isChannelMuted(membership)) {
|
||||
return counts;
|
||||
}
|
||||
|
||||
const mentions = collapsedThreads ? membership.mention_count_root : membership.mention_count;
|
||||
if (mentions && !isChannelMuted(membership)) {
|
||||
if (mentions) {
|
||||
counts.mentions += mentions;
|
||||
}
|
||||
|
||||
|
||||
Ссылка в новой задаче
Block a user