Browse Source

Change added contract accessors with constants

develop
Apostolos Fanakis 4 years ago
parent
commit
26f6000909
  1. 6
      packages/concordia-app/src/components/PostCreate/index.jsx

6
packages/concordia-app/src/components/PostCreate/index.jsx

@ -15,8 +15,10 @@ import { breeze, drizzle } from '../../redux/store';
import './styles.css';
import { TRANSACTION_ERROR, TRANSACTION_SUCCESS } from '../../constants/TransactionStatus';
import { POST_CONTENT, POST_SUBJECT } from '../../constants/PostsDatabaseKeys';
import { FORUM_CONTRACT } from '../../constants/ContractNames';
import { POST_CREATED_EVENT } from '../../constants/ForumContractEvents';
const { contracts: { Forum: { methods: { createPost } } } } = drizzle;
const { contracts: { [FORUM_CONTRACT]: { methods: { createPost } } } } = drizzle;
const { orbit } = breeze;
const PostCreate = (props) => {
@ -86,7 +88,7 @@ const PostCreate = (props) => {
setPosting(false);
} else if (transactions[transactionStack[createPostCacheSendStackId]].status === TRANSACTION_SUCCESS) {
const {
receipt: { events: { PostCreated: { returnValues: { postID: contractPostId } } } },
receipt: { events: { [POST_CREATED_EVENT]: { returnValues: { postID: contractPostId } } } },
} = transactions[transactionStack[createPostCacheSendStackId]];
const { stores } = orbit;

Loading…
Cancel
Save