Fixed PostsViewContainer to provide an initial currentLastViewed value (#2894)

Этот коммит содержится в:
Harrison Healey
2016-05-05 15:34:48 -04:00
коммит произвёл Corey Hulen
родитель cf05c92eff
Коммит 511be7714b

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

@@ -34,18 +34,26 @@ export default class PostsViewContainer extends React.Component {
scrollPost: null
};
if (currentChannelId) {
let lastViewed = Date.now();
const member = ChannelStore.getMember(currentChannelId);
if (member) {
lastViewed = member.last_viewed_at;
}
Object.assign(state, {
currentChannelIndex: 0,
channels: [currentChannelId],
postLists: [this.getChannelPosts(currentChannelId)],
atTop: [PostStore.getVisibilityAtTop(currentChannelId)]
atTop: [PostStore.getVisibilityAtTop(currentChannelId)],
currentLastViewed: lastViewed
});
} else {
Object.assign(state, {
currentChannelIndex: null,
channels: [],
postLists: [],
atTop: []
atTop: [],
currentLastViewed: Date.now()
});
}