summaryrefslogtreecommitdiffstats
path: root/webapp/actions
diff options
context:
space:
mode:
authorJoram Wilander <jwawilander@gmail.com>2016-12-21 16:35:01 -0500
committerChristopher Speller <crspeller@gmail.com>2016-12-21 16:35:01 -0500
commitba6e370ca71abacaa30234cb164427d27c86df13 (patch)
tree2379b6dab897deef1226f66772b8f05e0bb08f9c /webapp/actions
parent139cb52c99ac525f44a280803447bbbd88369f23 (diff)
downloadchat-ba6e370ca71abacaa30234cb164427d27c86df13.tar.gz
chat-ba6e370ca71abacaa30234cb164427d27c86df13.tar.bz2
chat-ba6e370ca71abacaa30234cb164427d27c86df13.zip
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
Diffstat (limited to 'webapp/actions')
-rw-r--r--webapp/actions/channel_actions.jsx2
-rw-r--r--webapp/actions/global_actions.jsx2
-rw-r--r--webapp/actions/post_actions.jsx2
-rw-r--r--webapp/actions/websocket_actions.jsx2
4 files changed, 4 insertions, 4 deletions
diff --git a/webapp/actions/channel_actions.jsx b/webapp/actions/channel_actions.jsx
index ad2f315ee..952c8ada3 100644
--- a/webapp/actions/channel_actions.jsx
+++ b/webapp/actions/channel_actions.jsx
@@ -53,7 +53,7 @@ export function executeCommand(message, args, success, error) {
export function setChannelAsRead(channelIdParam) {
const channelId = channelIdParam || ChannelStore.getCurrentId();
- AsyncClient.updateLastViewedAt();
+ AsyncClient.viewChannel();
ChannelStore.resetCounts(channelId);
ChannelStore.emitChange();
if (channelId === ChannelStore.getCurrentId()) {
diff --git a/webapp/actions/global_actions.jsx b/webapp/actions/global_actions.jsx
index 9d135dd26..e1009e9c2 100644
--- a/webapp/actions/global_actions.jsx
+++ b/webapp/actions/global_actions.jsx
@@ -48,7 +48,7 @@ export function emitChannelClickEvent(channel) {
getMyChannelMembersPromise.then(() => {
AsyncClient.getChannelStats(chan.id, true);
- AsyncClient.updateLastViewedAt(chan.id);
+ AsyncClient.viewChannel(chan.id, ChannelStore.getCurrentId());
loadPosts(chan.id);
trackPage();
});
diff --git a/webapp/actions/post_actions.jsx b/webapp/actions/post_actions.jsx
index d1e69cda7..71b9e826e 100644
--- a/webapp/actions/post_actions.jsx
+++ b/webapp/actions/post_actions.jsx
@@ -22,7 +22,7 @@ export function handleNewPost(post, msg) {
if (ChannelStore.getCurrentId() === post.channel_id) {
if (window.isActive) {
- AsyncClient.updateLastViewedAt(null, false);
+ AsyncClient.viewChannel();
} else {
AsyncClient.getChannel(post.channel_id);
}
diff --git a/webapp/actions/websocket_actions.jsx b/webapp/actions/websocket_actions.jsx
index 6c81a4ac9..f24802003 100644
--- a/webapp/actions/websocket_actions.jsx
+++ b/webapp/actions/websocket_actions.jsx
@@ -205,7 +205,7 @@ function handlePostEditEvent(msg) {
// Update channel state
if (ChannelStore.getCurrentId() === msg.broadcast.channel_id) {
if (window.isActive) {
- AsyncClient.updateLastViewedAt(null, false);
+ AsyncClient.viewChannel();
}
}
}