PLT-5173 fixing javascript error when creating DM on Android (#5077)

Этот коммит содержится в:
Corey Hulen
2017-01-16 16:51:46 -05:00
коммит произвёл Harrison Healey
родитель 441fe5334e
Коммит 7c9d0c313f

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

@@ -229,8 +229,16 @@ export default class PostViewController extends React.Component {
onPostListScroll(atBottom) {
if (atBottom) {
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});
} else {
this.setState({scrollType: ScrollTypes.FREE});
}