Added channel id to updateLastViewed api calls to prevent multiple updates to different channels from clashing
Этот коммит содержится в:
@@ -152,21 +152,23 @@ export function getChannel(id) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function updateLastViewedAt() {
|
export function updateLastViewedAt() {
|
||||||
if (isCallInProgress('updateLastViewed')) {
|
const channelId = ChannelStore.getCurrentId();
|
||||||
|
|
||||||
|
if (channelId === null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ChannelStore.getCurrentId() == null) {
|
if (isCallInProgress(`updateLastViewed${channelId}`)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
callTracker.updateLastViewed = utils.getTimestamp();
|
callTracker[`updateLastViewed${channelId}`] = utils.getTimestamp();
|
||||||
client.updateLastViewedAt(
|
client.updateLastViewedAt(
|
||||||
ChannelStore.getCurrentId(),
|
channelId,
|
||||||
function updateLastViewedAtSuccess() {
|
() => {
|
||||||
callTracker.updateLastViewed = 0;
|
callTracker.updateLastViewed = 0;
|
||||||
},
|
},
|
||||||
function updateLastViewdAtFailure(err) {
|
(err) => {
|
||||||
callTracker.updateLastViewed = 0;
|
callTracker.updateLastViewed = 0;
|
||||||
dispatchError(err, 'updateLastViewedAt');
|
dispatchError(err, 'updateLastViewedAt');
|
||||||
}
|
}
|
||||||
@@ -634,4 +636,4 @@ export function getMyTeam() {
|
|||||||
dispatchError(err, 'getMyTeam');
|
dispatchError(err, 'getMyTeam');
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user