mirror of
https://github.com/ecency/ecency-mobile.git
synced 2024-11-27 03:14:56 +03:00
quick bugfix:
This commit is contained in:
parent
a8febe5ec8
commit
e1b3071eb3
@ -18,7 +18,7 @@ export default EStyleSheet.create({
|
||||
flexDirection: 'row',
|
||||
},
|
||||
scroll: {
|
||||
height: '$deviceHeight / 1.113',
|
||||
height: '$deviceHeight / 1.135',
|
||||
},
|
||||
footer: {
|
||||
flexDirection: 'column',
|
||||
|
@ -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)}
|
||||
|
Loading…
Reference in New Issue
Block a user