all repos — caroster @ 7266f3b1f246e82f3d68c9e100922d3a2382808d

[Octree] Group carpool to your event https://caroster.io

:bug: Use fresh  profile data in profile page
Tim Izzo sika.tim@gmail.com
Wed, 22 Jul 2020 16:58:03 +0200
commit

7266f3b1f246e82f3d68c9e100922d3a2382808d

parent

fa7e1ec4a6f765bbf10f6363efe06c46978f788c

1 files changed, 5 insertions(+), 3 deletions(-)

jump to
M app/src/pages/Profile.jsapp/src/pages/Profile.js

@@ -5,11 +5,13 @@ import {useTranslation} from 'react-i18next';

import {useHistory} from 'react-router-dom'; import Loading from './Loading'; import Profile from '../containers/Profile'; +import useProfile from '../hooks/useProfile'; const ProfilePage = () => { const history = useHistory(); const {t} = useTranslation(); - const {authState, logout, updateProfile} = useAuth(); + const {logout, updateProfile} = useAuth(); + const {profile} = useProfile(); const menuActions = [ {

@@ -29,12 +31,12 @@ id: 'LogoutTabs',

}, ]; - if (!authState) return <Loading />; + if (!profile) return <Loading />; return ( <Layout menuTitle={t('profile.title')} menuActions={menuActions}> <Profile - profile={authState.user} + profile={profile} updateProfile={updateProfile} logout={logout} />