PLT-5678 Ensure all connections are closed on logout (#314)
This commit is contained in:
parent
9969ac52f2
commit
542555d3bb
1 changed files with 14 additions and 2 deletions
|
|
@ -377,7 +377,17 @@ export function startPeriodicStatusUpdates() {
|
|||
statusIntervalId = setInterval(
|
||||
() => {
|
||||
const {statuses} = getState().entities.users;
|
||||
getStatusesByIds(Object.keys(statuses))(dispatch, getState);
|
||||
|
||||
if (!statuses) {
|
||||
return;
|
||||
}
|
||||
|
||||
const userIds = Object.keys(statuses);
|
||||
if (!userIds.length) {
|
||||
return;
|
||||
}
|
||||
|
||||
getStatusesByIds(userIds)(dispatch, getState);
|
||||
},
|
||||
Constants.STATUS_INTERVAL
|
||||
);
|
||||
|
|
@ -386,7 +396,9 @@ export function startPeriodicStatusUpdates() {
|
|||
|
||||
export function stopPeriodicStatusUpdates() {
|
||||
return async () => {
|
||||
clearInterval(statusIntervalId);
|
||||
if (statusIntervalId) {
|
||||
clearInterval(statusIntervalId);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue