mirror of
https://github.com/mattermost/mattermost.git
synced 2025-02-25 18:55:24 -06:00
Fixed being unable to make the first post in a new channel (#4744)
This commit is contained in:
committed by
Joram Wilander
parent
5341e82ad7
commit
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:
|
||||
|
||||
Reference in New Issue
Block a user