Force updating last viewed at for new posts

Этот коммит содержится в:
JoramWilander
2015-10-23 11:22:08 -04:00
родитель 6724ef4314
Коммит fe82c43eeb
2 изменённых файлов: 3 добавлений и 3 удалений

Просмотреть файл

@@ -158,7 +158,7 @@ function handleNewPostEvent(msg) {
// Update channel state
if (ChannelStore.getCurrentId() === msg.channel_id) {
if (window.isActive) {
AsyncClient.updateLastViewedAt();
AsyncClient.updateLastViewedAt(true);
}
} else {
AsyncClient.getChannel(msg.channel_id);

Просмотреть файл

@@ -152,14 +152,14 @@ export function getChannel(id) {
);
}
export function updateLastViewedAt() {
export function updateLastViewedAt(force) {
const channelId = ChannelStore.getCurrentId();
if (channelId === null) {
return;
}
if (isCallInProgress(`updateLastViewed${channelId}`)) {
if (isCallInProgress(`updateLastViewed${channelId}`) && !force) {
return;
}