From 25d5de09ffa804e172cc72d15c4bcf9488fc7ac5 Mon Sep 17 00:00:00 2001 From: Nouman Tahir Date: Fri, 26 Feb 2021 13:16:46 +0500 Subject: [PATCH] added some log statement in dhive calls --- src/providers/hive/dhive.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/providers/hive/dhive.js b/src/providers/hive/dhive.js index 4f719deee..ad91571e7 100644 --- a/src/providers/hive/dhive.js +++ b/src/providers/hive/dhive.js @@ -301,6 +301,7 @@ export const getCommunities = async ( ) => new Promise(async (resolve, reject) => { try { + console.log("Getting communities", query) const data = await client.call('bridge', 'list_communities', { last, limit, @@ -440,6 +441,7 @@ export const ignoreUser = async (currentAccount, pin, data) => { export const getActiveVotes = (author, permlink) => new Promise((resolve, reject) => { try { + console.log("Getting active votes", author, permlink) client .call('condenser_api', 'get_active_votes', [author, permlink]) .then((result) => { @@ -455,6 +457,7 @@ export const getActiveVotes = (author, permlink) => export const getRankedPosts = async (query, currentUserName, filterNsfw) => { try { + console.log("Getting ranked posts:", query) let posts = await client.call('bridge', 'get_ranked_posts', query); if (posts) { @@ -465,6 +468,7 @@ export const getRankedPosts = async (query, currentUserName, filterNsfw) => { return updatedPosts; } } + console.log("Returning fetched posts: " + posts?posts.length:null) return posts; } catch (error) { return error; @@ -473,6 +477,7 @@ export const getRankedPosts = async (query, currentUserName, filterNsfw) => { export const getAccountPosts = async (query, currentUserName, filterNsfw) => { try { + console.log("Getting account posts: ", query) let posts = await client.call('bridge', 'get_account_posts', query); if (posts) { @@ -483,6 +488,7 @@ export const getAccountPosts = async (query, currentUserName, filterNsfw) => { return updatedPosts; } } + console.log("Returning fetched posts: " + posts?posts.length:null) return posts; } catch (error) { return error; @@ -491,6 +497,7 @@ export const getAccountPosts = async (query, currentUserName, filterNsfw) => { export const getRepliesByLastUpdate = async (query) => { try { + console.log("Getting replies: ", query) const replies = await client.database.call('get_replies_by_last_update', [ query.start_author, query.start_permlink, @@ -504,7 +511,9 @@ export const getRepliesByLastUpdate = async (query) => { }; export const getPost = async (author, permlink, currentUserName = null, isPromoted = false) => { + try { + console.log("Getting post: ", author, permlink) const post = await client.database.call('get_content', [author, permlink]); return post ? parsePost(post, currentUserName, isPromoted) : null;