diff --git a/src/components/comment/view/commentView.tsx b/src/components/comment/view/commentView.tsx index dbb7071612..e211509cca 100644 --- a/src/components/comment/view/commentView.tsx +++ b/src/components/comment/view/commentView.tsx @@ -104,6 +104,7 @@ const CommentView = ({ void; @@ -38,6 +39,7 @@ interface CommentBodyProps { const CommentBody = ({ body, + metadata, commentDepth, hideContent, handleOnContentPress, @@ -132,6 +134,7 @@ const CommentBody = ({ void; setSelectedImage: (imgUrl: string, postImageUrls: string[]) => void; diff --git a/src/components/quickReplyModal/usePostSubmitter.ts b/src/components/quickReplyModal/usePostSubmitter.ts index f24ffbf43b..9b016584bb 100644 --- a/src/components/quickReplyModal/usePostSubmitter.ts +++ b/src/components/quickReplyModal/usePostSubmitter.ts @@ -1,7 +1,7 @@ import { useDispatch } from "react-redux"; import { useAppSelector } from "../../hooks"; import { postComment } from "../../providers/hive/dhive"; -import { generateReplyPermlink, makeJsonMetadataReply } from "../../utils/editor"; +import { extractMetadata, generateReplyPermlink, makeJsonMetadata } from "../../utils/editor"; import { Alert } from "react-native"; import { updateCommentCache } from "../../redux/actions/cacheActions"; import { toastNotification } from "../../redux/actions/uiAction"; @@ -46,6 +46,13 @@ export const usePostSubmitter = () => { const category = parentPost.category || ''; const url = `/${category}/@${parentAuthor}/${parentPermlink}#@${author}/${permlink}`; + //adding jsonmeta with image ratios here.... + const meta = await extractMetadata({ + body:commentBody, + fetchRatios:true + }) + const jsonMetadata = makeJsonMetadata(meta, parentTags || ['ecency']) + console.log( currentAccount, pinCode, @@ -53,7 +60,7 @@ export const usePostSubmitter = () => { parentPermlink, permlink, commentBody, - parentTags, + jsonMetadata ); @@ -65,7 +72,8 @@ export const usePostSubmitter = () => { parentPermlink, permlink, commentBody, - parentTags, + [], + jsonMetadata ) userActivityMutation.mutate({ @@ -90,7 +98,7 @@ export const usePostSubmitter = () => { parent_author: parentAuthor, parent_permlink: parentPermlink, markdownBody: commentBody, - json_metadata: makeJsonMetadataReply(parentTags || ['ecency']) + json_metadata: jsonMetadata } dispatch( diff --git a/src/providers/hive/dhive.js b/src/providers/hive/dhive.js index 8ea88d7111..85427c3fbc 100644 --- a/src/providers/hive/dhive.js +++ b/src/providers/hive/dhive.js @@ -1510,7 +1510,7 @@ export const postComment = ( permlink, body, parentTags, - isEdit = false, + jsonMetadata = null, ) => _postContent( account, @@ -1520,7 +1520,7 @@ export const postComment = ( permlink, '', body, - makeJsonMetadataReply(parentTags || ['ecency']), + jsonMetadata ? jsonMetadata : makeJsonMetadataReply(parentTags || ['ecency']), null, null, ) diff --git a/src/redux/actions/cacheActions.ts b/src/redux/actions/cacheActions.ts index 4a62f8101c..4134b7f10d 100644 --- a/src/redux/actions/cacheActions.ts +++ b/src/redux/actions/cacheActions.ts @@ -18,7 +18,6 @@ import { DELETE_CLAIM_CACHE_ENTRY, } from '../constants/constants'; import { - ClaimCache, Comment, CacheStatus, Draft,