Merge branch 'master' of https://github.com/mattermost/platform into ui-improvements

This commit is contained in:
Asaad Mahmood
2015-10-23 21:33:15 +05:00
3 changed files with 5 additions and 5 deletions

View File

@@ -74,9 +74,9 @@ class BrowserStoreClass {
var result = null;
try {
if (this.isLocalStorageSupported()) {
result = JSON.parse(getPrefix() + localStorage.getItem(name));
result = JSON.parse(localStorage.getItem(getPrefix() + name));
} else {
result = JSON.parse(getPrefix() + sessionStorage.getItem(name));
result = JSON.parse(sessionStorage.getItem(getPrefix() + name));
}
} catch (err) {
result = null;

View File

@@ -158,7 +158,7 @@ function handleNewPostEvent(msg) {
// Update channel state
if (ChannelStore.getCurrentId() === msg.channel_id) {
if (window.isActive) {
AsyncClient.updateLastViewedAt();
AsyncClient.updateLastViewedAt(true);
}
} else {
AsyncClient.getChannel(msg.channel_id);

View File

@@ -152,14 +152,14 @@ export function getChannel(id) {
);
}
export function updateLastViewedAt() {
export function updateLastViewedAt(force) {
const channelId = ChannelStore.getCurrentId();
if (channelId === null) {
return;
}
if (isCallInProgress(`updateLastViewed${channelId}`)) {
if (isCallInProgress(`updateLastViewed${channelId}`) && !force) {
return;
}