The code powering m.abunchtell.com https://m.abunchtell.com
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

16 lines
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);