Force updating last viewed at for new posts
Этот коммит содержится в:
@@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user