PLT-5012 Combine updateLastViewedAt, setLastViewedAt and setActiveChannel into a single API (#4840)
* Combine updateLastViewedAt, setLastViewedAt and setActiveChannel into a single API * Remove preference DB writes
Этот коммит содержится в:
коммит произвёл
Christopher Speller
родитель
139cb52c99
Коммит
ba6e370ca7
@@ -94,7 +94,7 @@ export default class NeedsTeam extends React.Component {
|
||||
// Set up tracking for whether the window is active
|
||||
window.isActive = true;
|
||||
$(window).on('focus', () => {
|
||||
AsyncClient.updateLastViewedAt();
|
||||
AsyncClient.viewChannel();
|
||||
ChannelStore.resetCounts(ChannelStore.getCurrentId());
|
||||
ChannelStore.emitChange();
|
||||
window.isActive = true;
|
||||
@@ -103,7 +103,7 @@ export default class NeedsTeam extends React.Component {
|
||||
$(window).on('blur', () => {
|
||||
window.isActive = false;
|
||||
if (UserStore.getCurrentUser()) {
|
||||
AsyncClient.setActiveChannel('');
|
||||
AsyncClient.viewChannel('');
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@@ -32,7 +32,7 @@ export default class PostViewCache extends React.Component {
|
||||
|
||||
componentWillUnmount() {
|
||||
if (UserStore.getCurrentUser()) {
|
||||
AsyncClient.setActiveChannel('');
|
||||
AsyncClient.viewChannel('');
|
||||
}
|
||||
ChannelStore.removeChangeListener(this.onChannelChange);
|
||||
}
|
||||
|
||||
Ссылка в новой задаче
Block a user