- more!
This commit is contained in:
@@ -9,6 +9,10 @@ import Event from './Event.js';
|
||||
const matchStateToProps = (state) => {
|
||||
const event = getActiveEvent(state) || getDefaultEvent(state) || new EventRecord();
|
||||
|
||||
if (!event) {
|
||||
return {};
|
||||
}
|
||||
|
||||
return {
|
||||
description: event.get('description'),
|
||||
endTime: event.get('endTime'),
|
||||
@@ -27,8 +31,6 @@ const matchStateToProps = (state) => {
|
||||
};
|
||||
};
|
||||
|
||||
const mapDispatchToProps = (dispatch) => ({
|
||||
fetchEvents: () => dispatch(fetchEvents()),
|
||||
});
|
||||
const mapDispatchToProps = (dispatch) => ({});
|
||||
|
||||
export default connect(matchStateToProps, mapDispatchToProps)(Event);
|
||||
|
||||
@@ -9,7 +9,6 @@ export default class Event extends Component {
|
||||
return {
|
||||
description: PropTypes.string,
|
||||
endTime: PropTypes.string,
|
||||
fetchEvents: PropTypes.func,
|
||||
id: PropTypes.string,
|
||||
images: PropTypes.arrayOf(
|
||||
PropTypes.shape({
|
||||
@@ -60,10 +59,6 @@ export default class Event extends Component {
|
||||
super(props);
|
||||
}
|
||||
|
||||
componentDidMount() {
|
||||
this.props.fetchEvents();
|
||||
}
|
||||
|
||||
render() {
|
||||
const {
|
||||
description,
|
||||
|
||||
Reference in New Issue
Block a user