[Resolved]Logout while being under the Profile page throws exception. (#73)

This commit is contained in:
Qolzam
2018-07-10 18:00:16 +07:00
parent 037f333642
commit 930de94d1f
4 changed files with 7 additions and 6 deletions

View File

@@ -392,8 +392,8 @@ const mapStateToProps = (state: Map<string, any>, ownProps: ICommentGroupCompone
translate: getTranslate(state.get('locale')), translate: getTranslate(state.get('locale')),
commentsRequestStatus : commentsRequestStatus ? commentsRequestStatus.status : ServerRequestStatusType.NoAction, commentsRequestStatus : commentsRequestStatus ? commentsRequestStatus.status : ServerRequestStatusType.NoAction,
commentSlides, commentSlides,
avatar: user.avatar || '', avatar: user ? user.avatar : '',
fullName: user.fullName || '', fullName: user ? user.fullName : '',
userInfo: state.getIn(['user', 'info']) userInfo: state.getIn(['user', 'info'])
} }

View File

@@ -270,8 +270,8 @@ const mapStateToProps = (state: Map<string,any>, ownProps: IHomeHeaderComponentP
const user = state.getIn(['user', 'info', uid], {}) const user = state.getIn(['user', 'info', uid], {})
return { return {
translate: getTranslate(state.get('locale')), translate: getTranslate(state.get('locale')),
avatar: user.avatar || '', avatar: user ? user.avatar : '',
fullName: user.fullName || '', fullName: user ? user.fullName : '',
title: state.getIn(['global', 'headerTitle'], ''), title: state.getIn(['global', 'headerTitle'], ''),
notifyCount notifyCount
} }

View File

@@ -288,6 +288,7 @@ export class HomeComponent extends Component<IHomeComponentProps, IHomeComponent
[classes[`contentShift-${anchor}`]]: drawerOpen, [classes[`contentShift-${anchor}`]]: drawerOpen,
})} })}
> >
<HR enabled={loaded!} data={{ mergedPosts, loadDataStream, hasMorePosts }} /> <HR enabled={loaded!} data={{ mergedPosts, loadDataStream, hasMorePosts }} />
</main> </main>
</div> </div>

View File

@@ -289,8 +289,8 @@ const uid = state.getIn(['authorize', 'uid'])
const user = state.getIn(['user', 'info', uid]) const user = state.getIn(['user', 'info', uid])
return { return {
translate: getTranslate(state.get('locale')), translate: getTranslate(state.get('locale')),
avatar: user.avatar || '', avatar: user ? user.avatar : '',
fullName: user.fullName || '' fullName: user ? user.fullName : ''
} }
} }