client/src/components/SessionForm.js
changeset 168 ea92f4fe783d
parent 164 30a5baa31314
child 169 f98efa1bddd1
--- a/client/src/components/SessionForm.js	Tue Oct 09 19:07:47 2018 +0200
+++ b/client/src/components/SessionForm.js	Mon Oct 08 18:35:47 2018 +0200
@@ -30,9 +30,9 @@
   onGroupChange = (e) => {
     const groupName = e.target.value;
 
-    const group = this.props.groups.find((g) => g.get('name') === groupName);
+    const group = this.props.groups.find((g) => g.name === groupName);
 
-    this.props.sessionsActions.updateSession(this.props.currentSession, { group: groupName, protocol: group?group.get('protocol'):'' });
+    this.props.sessionsActions.updateSession(this.props.currentSession, { group: groupName, protocol: group?group.protocol:'' });
   }
 
   componentDidMount() {
@@ -44,7 +44,7 @@
   }
 
   componentWillUpdate = (nextProps, nextState) => {
-    if (nextState.createGroup && nextProps.createGroup.get('success')) {
+    if (nextState.createGroup && nextProps.createGroup.success) {
       this.setState({ createGroup: false })
     }
   }
@@ -206,14 +206,14 @@
 function mapStateToProps(state, props) {
 
   let group;
-  if (props.session && props.session.get('group')) {
-    group = state.get('groups').find(group => props.session.get('group') === group.get('name'))
+  if (props.session && props.session.group) {
+    group = state.groups.find(group => props.session.group === group.name)
   }
 
   return {
     currentSession: props.session,
-    createGroup: state.get('createGroup'),
-    groups: state.get('groups'),
+    createGroup: state.createGroup,
+    groups: state.groups,
     group
   };
 }