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 // Update channel state
if (ChannelStore.getCurrentId() === msg.channel_id) { if (ChannelStore.getCurrentId() === msg.channel_id) {
if (window.isActive) { if (window.isActive) {
AsyncClient.updateLastViewedAt(); AsyncClient.updateLastViewedAt(true);
} }
} else { } else {
AsyncClient.getChannel(msg.channel_id); AsyncClient.getChannel(msg.channel_id);

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

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