summaryrefslogtreecommitdiffstats
path: root/webapp/stores
diff options
context:
space:
mode:
authorJoramWilander <jwawilander@gmail.com>2017-05-12 08:00:28 -0400
committerJoramWilander <jwawilander@gmail.com>2017-05-12 08:00:28 -0400
commit9d109b070037951fcd0832b785eba8a3db9a157c (patch)
tree5d109da2e9e088f16eff0ad1421876a3d3da412e /webapp/stores
parentb1c39204a63a87d2cbc57f66cf9db50c938b2ee5 (diff)
parenta21a06afd9907e9911dcb166d902cba9f405c7cb (diff)
downloadchat-9d109b070037951fcd0832b785eba8a3db9a157c.tar.gz
chat-9d109b070037951fcd0832b785eba8a3db9a157c.tar.bz2
chat-9d109b070037951fcd0832b785eba8a3db9a157c.zip
Merge branch 'release-3.9' into merge-3.9
Diffstat (limited to 'webapp/stores')
-rw-r--r--webapp/stores/channel_store.jsx21
-rw-r--r--webapp/stores/localization_store.jsx2
2 files changed, 15 insertions, 8 deletions
diff --git a/webapp/stores/channel_store.jsx b/webapp/stores/channel_store.jsx
index db1bead46..58a7dfb78 100644
--- a/webapp/stores/channel_store.jsx
+++ b/webapp/stores/channel_store.jsx
@@ -20,6 +20,7 @@ const LAST_VIEVED_EVENT = 'last_viewed';
import store from 'stores/redux_store.jsx';
import * as Selectors from 'mattermost-redux/selectors/entities/channels';
import {ChannelTypes, UserTypes} from 'mattermost-redux/action_types';
+import {batchActions} from 'redux-batched-actions';
class ChannelStoreClass extends EventEmitter {
constructor(props) {
@@ -456,16 +457,22 @@ class ChannelStoreClass extends EventEmitter {
const channel = {...this.get(id)};
channel.total_msg_count++;
- store.dispatch({
- type: ChannelTypes.RECEIVED_CHANNEL,
- data: channel
- });
+ const actions = [];
if (markRead) {
- this.resetCounts([id]);
- } else {
- this.unreadCounts[id].msgs++;
+ actions.push({
+ type: ChannelTypes.RECEIVED_MY_CHANNEL_MEMBER,
+ data: {...member, msg_count: channel.total_msg_count}
+ });
}
+
+ actions.push(
+ {
+ type: ChannelTypes.RECEIVED_CHANNEL,
+ data: channel
+ }
+ );
+ store.dispatch(batchActions(actions));
}
incrementMentionsIfNeeded(id, msgProps) {
diff --git a/webapp/stores/localization_store.jsx b/webapp/stores/localization_store.jsx
index 2eb482699..0a25c860d 100644
--- a/webapp/stores/localization_store.jsx
+++ b/webapp/stores/localization_store.jsx
@@ -12,7 +12,7 @@ class LocalizationStoreClass extends EventEmitter {
constructor() {
super();
- this.currentLocale = 'en';
+ this.currentLocale = '';
this.currentTranslations = null;
}