summaryrefslogtreecommitdiffstats
path: root/web/react/components
diff options
context:
space:
mode:
Diffstat (limited to 'web/react/components')
-rw-r--r--web/react/components/channel_loader.jsx2
-rw-r--r--web/react/components/post_list.jsx5
-rw-r--r--web/react/components/sidebar.jsx4
-rw-r--r--web/react/components/sidebar_right.jsx6
4 files changed, 15 insertions, 2 deletions
diff --git a/web/react/components/channel_loader.jsx b/web/react/components/channel_loader.jsx
index 1b389aa1d..b7cb248db 100644
--- a/web/react/components/channel_loader.jsx
+++ b/web/react/components/channel_loader.jsx
@@ -12,8 +12,6 @@ var Constants = require('../utils/constants.jsx');
module.exports = React.createClass({
componentDidMount: function() {
- // Initalize stores
- BrowserStore.initalize();
/* Start initial aysnc loads */
AsyncClient.getMe();
diff --git a/web/react/components/post_list.jsx b/web/react/components/post_list.jsx
index d6dc9ce30..177e4a1db 100644
--- a/web/react/components/post_list.jsx
+++ b/web/react/components/post_list.jsx
@@ -78,6 +78,7 @@ module.exports = React.createClass({
PostStore.addChangeListener(this._onChange);
ChannelStore.addChangeListener(this._onChange);
+ UserStore.addStatusesChangeListener(this._onChange);
SocketStore.addChangeListener(this._onSocketChange);
$(".post-list-holder-by-time").perfectScrollbar();
@@ -157,6 +158,7 @@ module.exports = React.createClass({
componentWillUnmount: function() {
PostStore.removeChangeListener(this._onChange);
ChannelStore.removeChangeListener(this._onChange);
+ UserStore.removeStatusesChangeListener(this._onChange);
SocketStore.removeChangeListener(this._onSocketChange);
$('body').off('click.userpopover');
},
@@ -193,6 +195,9 @@ module.exports = React.createClass({
this.scrolledToNew = false;
}
this.setState(newState);
+ } else {
+ // Updates the timestamp on each post
+ this.forceUpdate()
}
},
_onSocketChange: function(msg) {
diff --git a/web/react/components/sidebar.jsx b/web/react/components/sidebar.jsx
index 0e4d38fe0..2095978e8 100644
--- a/web/react/components/sidebar.jsx
+++ b/web/react/components/sidebar.jsx
@@ -263,6 +263,10 @@ var SidebarLoggedIn = React.createClass({
if (ChannelStore.getCurrentId() != msg.channel_id) {
AsyncClient.getChannels(true);
}
+ } else if (msg.action == "user_added") {
+ if (UserStore.getCurrentId() === msg.user_id) {
+ AsyncClient.getChannels(true);
+ }
}
},
updateTitle: function() {
diff --git a/web/react/components/sidebar_right.jsx b/web/react/components/sidebar_right.jsx
index 8334b345b..60c8ffae6 100644
--- a/web/react/components/sidebar_right.jsx
+++ b/web/react/components/sidebar_right.jsx
@@ -16,10 +16,16 @@ module.exports = React.createClass({
componentDidMount: function() {
PostStore.addSearchChangeListener(this._onSearchChange);
PostStore.addSelectedPostChangeListener(this._onSelectedChange);
+ UserStore.addStatusesChangeListener(this._onChange);
},
componentWillUnmount: function() {
PostStore.removeSearchChangeListener(this._onSearchChange);
PostStore.removeSelectedPostChangeListener(this._onSelectedChange);
+ UserStore.removeStatusesChangeListener(this._onChange);
+ },
+ _onChange: function() {
+ // Updates the timestamp on each post
+ this.forceUpdate();
},
_onSelectedChange: function(from_search) {
if (this.isMounted()) {