quick bugfix:

This commit is contained in:
ue 2018-11-05 15:14:14 +03:00
parent a8febe5ec8
commit e1b3071eb3
2 changed files with 14 additions and 9 deletions

View File

@ -18,7 +18,7 @@ export default EStyleSheet.create({
flexDirection: 'row',
},
scroll: {
height: '$deviceHeight / 1.113',
height: '$deviceHeight / 1.135',
},
footer: {
flexDirection: 'column',

View File

@ -27,6 +27,7 @@ class PostDisplayView extends Component {
this.state = {
postHeight: 0,
scrollHeight: 0,
isLoadedComments: false,
};
}
@ -105,9 +106,12 @@ class PostDisplayView extends Component {
render() {
const { post, currentUser } = this.props;
const { postHeight, scrollHeight } = this.state;
const { postHeight, scrollHeight, isLoadedComments } = this.state;
const isPostEnd = scrollHeight > postHeight;
const isGetComment = scrollHeight + 300 > postHeight;
isGetComment && !isLoadedComments && this.setState({ isLoadedComments: true });
return (
<View style={styles.container}>
@ -141,13 +145,14 @@ class PostDisplayView extends Component {
</View>
)}
</View>
{post && (
<CommentsDisplay
currentUser={currentUser}
author={post.author}
permlink={post.permlink}
commentCount={post.children}
/>
{post
&& (isGetComment || isLoadedComments) && (
<CommentsDisplay
currentUser={currentUser}
author={post.author}
permlink={post.permlink}
commentCount={post.children}
/>
)}
</ScrollView>
{!isPostEnd && this._getTabBar(true)}