diff options
-rw-r--r-- | webapp/components/posts_view_container.jsx | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/webapp/components/posts_view_container.jsx b/webapp/components/posts_view_container.jsx index c0a74ca84..d1d8a2093 100644 --- a/webapp/components/posts_view_container.jsx +++ b/webapp/components/posts_view_container.jsx @@ -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() }); } |