fixed profile bug changed endpoint for desteem

This commit is contained in:
u-e 2019-02-05 12:05:53 +03:00
parent d474e20bf2
commit ba857865f5
2 changed files with 7 additions and 22 deletions

View File

@ -155,27 +155,10 @@ export const vestToSteem = async (vestingShares, totalVestingShares, totalVestin
* (parseFloat(vestingShares) / parseFloat(totalVestingShares))
).toFixed(0);
/**
* @method getFollows get account data
* @param user username
*/
export const getFollows = user => new Promise((resolve, reject) => {
client
.call('follow_api', 'get_follow_count', [user])
.then((result) => {
resolve(result);
})
.catch((err) => {
reject(err);
});
});
export const getFollows = username => client.database.call('get_follow_count', [username]);
/**
* @method getFollowing
* @param user username
* TODO: Pagination
*/
export const getFollowing = (follower, startFollowing, followType = 'blog', limit = 100) => client.database.call('get_following', [follower, startFollowing, followType, limit]);
export const getFollowers = (follower, startFollowing, followType = 'blog', limit = 100) => client.database.call('get_followers', [follower, startFollowing, followType, limit]);
export const getIsFollowing = (user, author) => new Promise((resolve, reject) => {

View File

@ -216,9 +216,11 @@ class ProfileContainer extends Component {
});
}
await getFollows(username).then((res) => {
follows = res;
});
try {
follows = await getFollows(username);
} catch (err) {
follows = null;
}
this.setState({
follows,