Skip to content

Commit

Permalink
PLT-5173 fixing javascript error when creating DM on Android (matterm…
Browse files Browse the repository at this point in the history
  • Loading branch information
coreyhulen authored and hmhealey committed Jan 16, 2017
1 parent 7f5cf30 commit 026c975
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion components/post_view/post_view_controller.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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});
}
Expand Down

0 comments on commit 026c975

Please sign in to comment.