Skip to content

Commit

Permalink
Merge pull request redacademy#130 from redacademy/no-talks-fix
Browse files Browse the repository at this point in the history
implemented fix for when user has no talks breaking app
  • Loading branch information
codedavinci authored Sep 22, 2017
2 parents 67ffa9e + dd615a7 commit fd949e8
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion js/scenes/Dashboard/DashboardContainer.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ const DashboardContainer = ({ userData, talksData }) => {
>
<Dashboard stats={currUser.speakerStats} />
<MyTalks
talks={findTalks(currUser.myTalks, talks)}
talks={(currUser.myTalks) && findTalks(currUser.myTalks, talks)}
userName={currUser.fullName}
/>
</Swiper>
Expand Down
6 changes: 5 additions & 1 deletion js/scenes/Dashboard/Pages/MyTalks.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ const MyTalks = ({ talks, userName }) => (

export default MyTalks;

MyTalks.defaultProps = {
talks: null
};

MyTalks.propTypes = {
talks: PropTypes.arrayOf(PropTypes.shape({
eventCode: PropTypes.string,
Expand All @@ -50,5 +54,5 @@ MyTalks.propTypes = {
})),
talk_id: PropTypes.string,
title: PropTypes.string
})).isRequired
}))
}
2 changes: 1 addition & 1 deletion js/scenes/Home/HomeComponents.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export const EventInfo = ({ nextEvent }) => (
{Moment.unix(nextEvent.date).format('MMMM Do YYYY')}
</Text>
<Text style={styles.eventDate}>
{Moment.unix(nextEvent.startTime).format('hh:mm a')} - {Moment.unix(nextEvent.endTime).format('hh:mm a')}
{Moment.unix(nextEvent.startTime).format('hh:mm a')} - {Moment.unix(nextEvent.endTime).local().format('hh:mm a')}
</Text>
</View>
)
Expand Down

0 comments on commit fd949e8

Please sign in to comment.