diff --git a/package.json b/package.json index 1440e0a7b7..68644d88de 100644 --- a/package.json +++ b/package.json @@ -38,7 +38,7 @@ "@esteemapp/react-native-autocomplete-input": "^4.2.1", "@esteemapp/react-native-multi-slider": "^1.1.0", "@esteemapp/react-native-slider": "^0.12.0", - "@hiveio/dhive": "^1.2.5", + "@hiveio/dhive": "^1.3.0", "@lottiefiles/react-lottie-player": "^3.5.3", "@native-html/iframe-plugin": "^2.6.1", "@native-html/table-plugin": "^5.3.1", diff --git a/src/providers/hive/dhive.js b/src/providers/hive/dhive.js index 6c01309dc6..a3b62b3be1 100644 --- a/src/providers/hive/dhive.js +++ b/src/providers/hive/dhive.js @@ -746,8 +746,11 @@ export const getPost = async (author, permlink, currentUserName = null, isPromot try { console.log('Getting post: ', author, permlink); const post = await client.call('bridge', 'get_post', { author, permlink }); + console.log("post fetched", post?.post_id) return post ? parsePost(post, currentUserName, isPromoted) : null; } catch (error) { + console.warn(error) + bugsnagInstance.notify(error) return error; } }; diff --git a/src/utils/postParser.tsx b/src/utils/postParser.tsx index 8dd4618f16..55e6f08143 100644 --- a/src/utils/postParser.tsx +++ b/src/utils/postParser.tsx @@ -57,7 +57,7 @@ export const parsePost = ( const imgRatios = post.json_metadata.image_ratios; if (typeof imgRatios[0] === 'number' && !Number.isNaN(imgRatios[0])) { [post.thumbRatio] = post.json_metadata.image_ratios; - } else if (imgRatios.length && imgRatios[0].height && imgRatios[0].width) { + } else if (imgRatios.length && imgRatios[0]?.height && imgRatios[0]?.width) { // convert to image ratio if old meta data found post.json_metadata.image_ratios = imgRatios.map((item) => { const ratio = item.width / item.height; diff --git a/yarn.lock b/yarn.lock index 5024aba995..7f4607b3b5 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1997,10 +1997,10 @@ dependencies: "@hapi/hoek" "^9.0.0" -"@hiveio/dhive@^1.2.5": - version "1.2.8" - resolved "https://registry.yarnpkg.com/@hiveio/dhive/-/dhive-1.2.8.tgz#1ad13d92649a6db8c01b3a80872bcba218f91ba9" - integrity sha512-prarzjLnnQagE4wdcdeSzPuzlW7sw/WE6WYJ/mXHuqwiyay2cK8fyoRgGdE5bDQYEzgH5x+jQELbJYbg0ZJ5Sg== +"@hiveio/dhive@^1.3.0": + version "1.3.0" + resolved "https://registry.yarnpkg.com/@hiveio/dhive/-/dhive-1.3.0.tgz#352c1a0597a8262d78a954d425865b2460e0ea37" + integrity sha512-5MflC3/dMPSN5ZJ/6970PAubRTzwyHDxxb62Z6fs1NXA7Ut79yoNpFGXO9BlsdEmdcFeVsfb9vJx1e0enDQ5bQ== dependencies: bigi "^1.4.2" bs58 "^4.0.1"