Do not send push notifications for channels being actively viewed (#3931)
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
eb0111f6bb
Коммит
f32eb525f3
@@ -113,7 +113,7 @@ export function getChannel(id) {
|
||||
);
|
||||
}
|
||||
|
||||
export function updateLastViewedAt(id) {
|
||||
export function updateLastViewedAt(id, active) {
|
||||
let channelId;
|
||||
if (id) {
|
||||
channelId = id;
|
||||
@@ -129,9 +129,17 @@ export function updateLastViewedAt(id) {
|
||||
return;
|
||||
}
|
||||
|
||||
let isActive;
|
||||
if (active == null) {
|
||||
isActive = true;
|
||||
} else {
|
||||
isActive = active;
|
||||
}
|
||||
|
||||
callTracker[`updateLastViewed${channelId}`] = utils.getTimestamp();
|
||||
Client.updateLastViewedAt(
|
||||
channelId,
|
||||
isActive,
|
||||
() => {
|
||||
callTracker[`updateLastViewed${channelId}`] = 0;
|
||||
ErrorStore.clearLastError();
|
||||
@@ -753,6 +761,24 @@ export function getStatuses() {
|
||||
);
|
||||
}
|
||||
|
||||
export function setActiveChannel(channelId) {
|
||||
if (isCallInProgress(`setActiveChannel${channelId}`)) {
|
||||
return;
|
||||
}
|
||||
|
||||
callTracker[`setActiveChannel${channelId}`] = utils.getTimestamp();
|
||||
Client.setActiveChannel(
|
||||
channelId,
|
||||
() => {
|
||||
callTracker[`setActiveChannel${channelId}`] = 0;
|
||||
},
|
||||
(err) => {
|
||||
callTracker[`setActiveChannel${channelId}`] = 0;
|
||||
dispatchError(err, 'setActiveChannel');
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
export function getMyTeam() {
|
||||
if (isCallInProgress('getMyTeam')) {
|
||||
return null;
|
||||
|
||||
Ссылка в новой задаче
Block a user