PLT-6610 sending websocket event for last channel viewed (#6787)
Этот коммит содержится в:
коммит произвёл
Christopher Speller
родитель
bf81fea9f8
Коммит
eb7561e05b
@@ -225,6 +225,10 @@ function handleEvent(msg) {
|
||||
handleAddEmoji(msg);
|
||||
break;
|
||||
|
||||
case SocketEvents.CHANNEL_VIEWED:
|
||||
handleChannelViewedEvent(msg);
|
||||
break;
|
||||
|
||||
default:
|
||||
}
|
||||
}
|
||||
@@ -433,3 +437,12 @@ function handleReactionRemovedEvent(msg) {
|
||||
data: reaction
|
||||
});
|
||||
}
|
||||
|
||||
function handleChannelViewedEvent(msg) {
|
||||
// Useful for when multiple devices have the app open to different channels
|
||||
if (ChannelStore.getCurrentId() !== msg.data.channel_id &&
|
||||
UserStore.getCurrentId() === msg.broadcast.user_id) {
|
||||
// Mark previous and next channel as read
|
||||
ChannelStore.resetCounts([msg.data.channel_id]);
|
||||
}
|
||||
}
|
||||
|
||||
Ссылка в новой задаче
Block a user