Skip to content
This repository has been archived by the owner on Oct 1, 2019. It is now read-only.

Commit

Permalink
Make user.more.roles to be immutable
Browse files Browse the repository at this point in the history
Caused blocking error in SettingsPage
  • Loading branch information
artkravchenko authored and voidxnull committed Nov 13, 2016
1 parent a22b14b commit c5f3854
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/pages/settings.js
Expand Up @@ -121,7 +121,7 @@ class SettingsPage extends React.Component {
return false;
}

const roles = (current_user.getIn(['user', 'more', 'roles']) || i.List()).toJS();
const roles = current_user.getIn(['user', 'more', 'roles'], i.List()).toJS();

const client = new ApiClient(API_HOST);
const triggers = new ActionsTrigger(client, this.props.dispatch);
Expand Down
2 changes: 1 addition & 1 deletion src/store/users.js
Expand Up @@ -60,7 +60,7 @@ export default function reducer(state = initialState, action) {

if (action.user) {
if (action.user.more && action.user.more.roles) {
state = state.setIn([action.user.id, 'more', 'roles'], action.user.more.roles);
state = state.setIn([action.user.id, 'more', 'roles'], i.fromJS(action.user.more.roles));
}
}

Expand Down

0 comments on commit c5f3854

Please sign in to comment.