client/src/components/Navbar.js
changeset 62 b2514a9bcd49
parent 59 1eb52770eefa
child 65 14989b339e5d
--- a/client/src/components/Navbar.js	Tue Jun 20 12:11:57 2017 +0200
+++ b/client/src/components/Navbar.js	Tue Jun 20 14:13:15 2017 +0200
@@ -1,4 +1,3 @@
-
 import PropTypes from 'prop-types';
 import React, { Component } from 'react';
 import { connect } from 'react-redux';
@@ -36,9 +35,9 @@
 
   renderLogin() {
 
-    if (this.props.currentUser) {
+    if (this.props.isAuthenticated) {
       return (
-        <NavDropdown title={ this.props.currentUser.username } id="user-dropdown">
+        <NavDropdown title={ this.props.currentUser.get('username') } id="user-dropdown">
           <MenuItem onClick={this.onClickSettings}>Settings</MenuItem>
           <MenuItem onClick={this.onClickLogout}>Logout</MenuItem>
         </NavDropdown>
@@ -78,8 +77,8 @@
 
 function mapStateToProps(state, props) {
   return {
-    isAuthenticated: state.get('isAuthenticated'),
-    currentUser: state.get('currentUser'),
+    isAuthenticated: state['isAuthenticated'],
+    currentUser: state['currentUser'],
   };
 }