Handling nulls in getMyChannelMember (#2493)

* Handling nulls in getMyChannelMember

* Addressing review comments
This commit is contained in:
Jesús Espino 2019-01-08 22:43:11 +01:00 committed by Harrison Healey
parent 982cd7b7b1
commit b810575ccd

View file

@ -15,12 +15,13 @@ import ChannelPeek from './channel_peek';
function mapStateToProps(state, ownProps) {
const channelId = ownProps.channelId;
const myMember = getMyChannelMember(state, channelId);
return {
channelId,
currentUserId: getCurrentUserId(state),
postIds: getPostIdsInChannel(state, channelId),
lastViewedAt: getMyChannelMember(state, channelId).last_viewed_at,
lastViewedAt: myMember && myMember.last_viewed_at,
theme: getTheme(state),
};
}