diff --git a/src/providers/steem/dsteem.js b/src/providers/steem/dsteem.js index a74c20d6d..91cf22414 100644 --- a/src/providers/steem/dsteem.js +++ b/src/providers/steem/dsteem.js @@ -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) => { diff --git a/src/screens/profile/container/profileContainer.js b/src/screens/profile/container/profileContainer.js index 8e3efe34a..7fe4ee9ec 100644 --- a/src/screens/profile/container/profileContainer.js +++ b/src/screens/profile/container/profileContainer.js @@ -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,