client/src/components/Settings.js
changeset 168 ea92f4fe783d
parent 151 57d63a248f0d
child 170 7da1d5137b0b
--- a/client/src/components/Settings.js	Tue Oct 09 19:07:47 2018 +0200
+++ b/client/src/components/Settings.js	Mon Oct 08 18:35:47 2018 +0200
@@ -5,10 +5,12 @@
 import Navbar from './Navbar';
 import * as userActions from '../actions/userActions';
 import './Settings.css';
+import { getCurrentUser } from '../selectors/authSelectors';
 
 class Settings extends Component {
 
-  updateSettings = () => {
+  updateSettings = (e) => {
+    e.preventDefault();
     const username = this.props.currentUser.username;
     const firstname = this.firstname.value;
     const lastname = this.lastname.value;
@@ -58,7 +60,7 @@
 
 function mapStateToProps(state, props) {
   return {
-    currentUser: state.getIn(['authStatus', 'currentUser']),
+    currentUser: getCurrentUser(state),
   };
 }