Fixed being unable to make the first post in a new channel (#4744)

Этот коммит содержится в:
Harrison Healey
2016-12-09 07:53:36 -05:00
коммит произвёл Joram Wilander
родитель 5341e82ad7
Коммит d7ee335106

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

@@ -191,8 +191,19 @@ export default class PostViewController extends React.Component {
onPostsViewJumpRequest(type, postId) {
switch (type) {
case Constants.PostsViewJumpTypes.BOTTOM: {
let lastViewedBottom;
const lastPost = PostStore.getLatestPost(this.state.channel.id);
this.setState({scrollType: ScrollTypes.BOTTOM, lastViewedBottom: lastPost.create_at || new Date().getTime()});
if (lastPost && lastPost.create_at) {
lastViewedBottom = lastPost.create_at;
} else {
lastViewedBottom = new Date().getTime();
}
this.setState({
scrollType: ScrollTypes.BOTTOM,
lastViewedBottom
});
break;
}
case Constants.PostsViewJumpTypes.POST: