incorporate channel updateAt into channel counts and pull channel data on channel update
Этот коммит содержится в:
@@ -74,7 +74,7 @@ module.exports = React.createClass({
|
||||
moreChannels = (
|
||||
<table className='more-channel-table table'>
|
||||
<tbody>
|
||||
{moreChannels.map(function cMap(channel) {
|
||||
{channels.map(function cMap(channel) {
|
||||
return (
|
||||
<tr key={channel.id}>
|
||||
<td>
|
||||
|
||||
@@ -161,7 +161,6 @@ module.exports = React.createClass({
|
||||
AsyncClient.updateLastViewedAt();
|
||||
}
|
||||
} else {
|
||||
console.log('hit');
|
||||
AsyncClient.getChannels();
|
||||
}
|
||||
|
||||
|
||||
@@ -99,11 +99,13 @@ function getChannels(force, updateLastViewed, checkVersion) {
|
||||
}
|
||||
|
||||
var countMap = data.counts;
|
||||
var updateAtMap = data.update_times;
|
||||
|
||||
for (var id in countMap) {
|
||||
var chan = ChannelStore.get(id);
|
||||
var c = ChannelStore.get(id);
|
||||
var count = countMap[id];
|
||||
if (!chan || chan.total_msg_count !== count) {
|
||||
var updateAt = updateAtMap[id];
|
||||
if (!c || c.total_msg_count !== count || updateAt > c.update_at) {
|
||||
getChannel(id);
|
||||
}
|
||||
}
|
||||
|
||||
Ссылка в новой задаче
Block a user