Clean user state on logout. Allow flagging only if not banned.

This commit is contained in:
gaba
2017-01-05 15:34:27 -03:00
parent ab825512b9
commit ac6fba2286
3 changed files with 4 additions and 1 deletions
+1
View File
@@ -4,3 +4,4 @@ export const SAVE_BIO_FAILURE = 'SAVE_BIO_FAILURE';
export const COMMENTS_BY_USER_REQUEST = 'COMMENTS_BY_USER_REQUEST';
export const COMMENTS_BY_USER_SUCCESS = 'COMMENTS_BY_USER_SUCCESS';
export const COMMENTS_BY_USER_FAILURE = 'COMMENTS_BY_USER_FAILURE';
export const LOGOUT_SUCCESS = 'LOGOUT_SUCCESS';
+2
View File
@@ -37,6 +37,8 @@ export default function user (state = initialState, action) {
return state.set('myComments', action.comments);
case assetActions.MULTIPLE_ASSETS_SUCCESS:
return state.set('myAssets', action.assets);
case actions.LOGOUT_SUCCESS:
return initialState;
default :
return state;
}
+1 -1
View File
@@ -102,7 +102,7 @@ class FlagButton extends Component {
const popupMenu = getPopupMenu[this.state.step](this.state.itemType);
return <div className={`${name}-container`}>
<button onClick={this.onReportClick} className={`${name}-button`}>
<button onClick={!this.props.banned ? this.onReportClick : null} className={`${name}-button`}>
{
flagged
? <span className={`${name}-button-text`}>{lang.t('reported')}</span>