mirror of
https://github.com/ecency/ecency-mobile.git
synced 2024-12-03 11:40:44 +03:00
Added new feature to profile page: get comments instead of replies for other user
This commit is contained in:
parent
fb7828e865
commit
cc31c568ac
@ -9,6 +9,7 @@ import {
|
||||
ignoreUser,
|
||||
getFollows,
|
||||
getRepliesByLastUpdate,
|
||||
getUserComments,
|
||||
getUser,
|
||||
getIsFollowing,
|
||||
getIsMuted,
|
||||
@ -98,11 +99,20 @@ class ProfileContainer extends Component {
|
||||
}
|
||||
|
||||
_getReplies = async (user) => {
|
||||
await getRepliesByLastUpdate({ start_author: user, limit: 10 }).then((result) => {
|
||||
this.setState({
|
||||
comments: result,
|
||||
const { isReverseHeader } = this.state;
|
||||
if (isReverseHeader) {
|
||||
await getUserComments({ start_author: user, limit: 10 }).then((result) => {
|
||||
this.setState({
|
||||
comments: result,
|
||||
});
|
||||
});
|
||||
});
|
||||
} else {
|
||||
await getRepliesByLastUpdate({ start_author: user, limit: 10 }).then((result) => {
|
||||
this.setState({
|
||||
comments: result,
|
||||
});
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
_handleFollowUnfollowUser = async (isFollowAction) => {
|
||||
|
@ -105,8 +105,8 @@ class ProfileScreen extends PureComponent {
|
||||
if (about) {
|
||||
_about = about.about;
|
||||
coverImage = about.cover_image;
|
||||
location = about.location;
|
||||
website = about.website;
|
||||
({ location } = about);
|
||||
({ website } = about);
|
||||
}
|
||||
return (
|
||||
<Fragment>
|
||||
@ -192,9 +192,12 @@ class ProfileScreen extends PureComponent {
|
||||
/>
|
||||
</View>
|
||||
<View
|
||||
tabLabel={intl.formatMessage({
|
||||
id: 'profile.replies',
|
||||
})}
|
||||
tabLabel={isReverseHeader
|
||||
? intl.formatMessage({
|
||||
id: 'profile.comments',
|
||||
}) : intl.formatMessage({
|
||||
id: 'profile.replies',
|
||||
})}
|
||||
style={styles.commentsTabBar}
|
||||
>
|
||||
{comments && comments.length > 0 ? (
|
||||
|
Loading…
Reference in New Issue
Block a user