PLT-5173 fixing javascript error when creating DM on Android (#5077)
Этот коммит содержится в:
коммит произвёл
Harrison Healey
родитель
441fe5334e
Коммит
7c9d0c313f
@@ -229,8 +229,16 @@ export default class PostViewController extends React.Component {
|
|||||||
|
|
||||||
onPostListScroll(atBottom) {
|
onPostListScroll(atBottom) {
|
||||||
if (atBottom) {
|
if (atBottom) {
|
||||||
|
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});
|
||||||
} else {
|
} else {
|
||||||
this.setState({scrollType: ScrollTypes.FREE});
|
this.setState({scrollType: ScrollTypes.FREE});
|
||||||
}
|
}
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user