diff options
Diffstat (limited to 'web/react')
-rw-r--r-- | web/react/stores/browser_store.jsx | 4 | ||||
-rw-r--r-- | web/react/stores/socket_store.jsx | 2 | ||||
-rw-r--r-- | web/react/utils/async_client.jsx | 4 |
3 files changed, 5 insertions, 5 deletions
diff --git a/web/react/stores/browser_store.jsx b/web/react/stores/browser_store.jsx index adaca44ee..75fb8aa3c 100644 --- a/web/react/stores/browser_store.jsx +++ b/web/react/stores/browser_store.jsx @@ -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; diff --git a/web/react/stores/socket_store.jsx b/web/react/stores/socket_store.jsx index 8c3489001..9410c1e9c 100644 --- a/web/react/stores/socket_store.jsx +++ b/web/react/stores/socket_store.jsx @@ -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); diff --git a/web/react/utils/async_client.jsx b/web/react/utils/async_client.jsx index fb7631159..b1bc71d54 100644 --- a/web/react/utils/async_client.jsx +++ b/web/react/utils/async_client.jsx @@ -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; } |