added getChannelCounts service and refactored the client to more intelligently pull channel data

Этот коммит содержится в:
JoramWilander
2015-08-10 14:47:45 -04:00
родитель 1c0ee4d2f6
Коммит 6c0fefad15
10 изменённых файлов: 343 добавлений и 168 удалений

Просмотреть файл

@@ -157,9 +157,12 @@ module.exports = React.createClass({
onSocketChange: function(msg) {
if (msg.action === 'posted') {
if (ChannelStore.getCurrentId() === msg.channel_id) {
if (window.isActive) AsyncClient.updateLastViewedAt();
if (window.isActive) {
AsyncClient.updateLastViewedAt();
}
} else {
AsyncClient.getChannel(msg.channel_id);
console.log('hit');
AsyncClient.getChannels();
}
if (UserStore.getCurrentId() !== msg.user_id) {
@@ -213,7 +216,7 @@ module.exports = React.createClass({
utils.ding();
}
}
} else if (msg.action === "viewed") {
} else if (msg.action === 'viewed') {
if (ChannelStore.getCurrentId() !== msg.channel_id && UserStore.getCurrentId() === msg.user_id) {
AsyncClient.getChannel(msg.channel_id);
}