Fixed being unable to make the first post in a new channel (#4744)
Этот коммит содержится в:
коммит произвёл
Joram Wilander
родитель
5341e82ad7
Коммит
d7ee335106
@@ -191,8 +191,19 @@ export default class PostViewController extends React.Component {
|
|||||||
onPostsViewJumpRequest(type, postId) {
|
onPostsViewJumpRequest(type, postId) {
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case Constants.PostsViewJumpTypes.BOTTOM: {
|
case Constants.PostsViewJumpTypes.BOTTOM: {
|
||||||
|
let lastViewedBottom;
|
||||||
const lastPost = PostStore.getLatestPost(this.state.channel.id);
|
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;
|
break;
|
||||||
}
|
}
|
||||||
case Constants.PostsViewJumpTypes.POST:
|
case Constants.PostsViewJumpTypes.POST:
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user