mirror of
https://github.com/ecency/ecency-mobile.git
synced 2024-11-24 08:55:14 +03:00
support for injecting image ratios in wave/comment jsonmetadata
This commit is contained in:
parent
7a67e4a3d9
commit
334ad9bd1a
@ -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(
|
||||
|
@ -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,
|
||||
)
|
||||
|
@ -18,7 +18,6 @@ import {
|
||||
DELETE_CLAIM_CACHE_ENTRY,
|
||||
} from '../constants/constants';
|
||||
import {
|
||||
ClaimCache,
|
||||
Comment,
|
||||
CacheStatus,
|
||||
Draft,
|
||||
|
Loading…
Reference in New Issue
Block a user