mirror of
https://github.com/kingomarnajjar/flex-template-web.git
synced 2026-07-27 19:42:11 +10:00
Ensure tx listing
This commit is contained in:
parent
20377b9935
commit
6915e640a2
1 changed files with 9 additions and 4 deletions
|
|
@ -4,7 +4,7 @@ import { injectIntl, intlShape } from 'react-intl';
|
|||
import classNames from 'classnames';
|
||||
import { Avatar } from '../../components';
|
||||
import { formatDate } from '../../util/dates';
|
||||
import { ensureTransaction, ensureUser } from '../../util/data';
|
||||
import { ensureTransaction, ensureUser, ensureListing } from '../../util/data';
|
||||
import * as propTypes from '../../util/propTypes';
|
||||
|
||||
import css from './ActivityFeed.css';
|
||||
|
|
@ -143,9 +143,14 @@ export const ActivityFeedComponent = props => {
|
|||
: [];
|
||||
const currentCustomer = ensureUser(currentTransaction.customer);
|
||||
const currentProvider = ensureUser(currentTransaction.provider);
|
||||
const currentListing = ensureListing(currentTransaction.listing);
|
||||
|
||||
const transitionsAvailable =
|
||||
currentUser && currentUser.id && currentCustomer.id && currentProvider.id;
|
||||
const transitionsAvailable = !!(
|
||||
currentUser &&
|
||||
currentUser.id &&
|
||||
currentCustomer.id &&
|
||||
currentProvider.id
|
||||
);
|
||||
|
||||
const isMessage = item => item && item.type === 'message';
|
||||
|
||||
|
|
@ -166,7 +171,7 @@ export const ActivityFeedComponent = props => {
|
|||
currentUser={currentUser}
|
||||
customer={currentCustomer}
|
||||
provider={currentProvider}
|
||||
listingTitle={currentTransaction.listing.attributes.title}
|
||||
listingTitle={currentListing.attributes.title}
|
||||
intl={intl}
|
||||
/>
|
||||
);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue