The code powering m.abunchtell.com https://m.abunchtell.com
Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.
 
 
 
 

16 rader
650 B

  1. import { connect } from 'react-redux';
  2. import Conversation from '../components/conversation';
  3. const mapStateToProps = (state, { conversationId }) => {
  4. const conversation = state.getIn(['conversations', 'items']).find(x => x.get('id') === conversationId);
  5. const lastStatus = state.getIn(['statuses', conversation.get('last_status')], null);
  6. return {
  7. accounts: conversation.get('accounts').map(accountId => state.getIn(['accounts', accountId], null)),
  8. lastStatus,
  9. lastAccount: lastStatus === null ? null : state.getIn(['accounts', lastStatus.get('account')], null),
  10. };
  11. };
  12. export default connect(mapStateToProps)(Conversation);