Skip to content

Commit

Permalink
[system admin - users] role selector: make it be compatible with old …
Browse files Browse the repository at this point in the history
…data(roles not in the present availableRoles (#5806)
  • Loading branch information
llj authored Dec 1, 2023
1 parent 86ba475 commit 825b3c3
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion frontend/src/pages/sys-admin/users/users-content.js
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,11 @@ class Item extends Component {
isSelected: item == curRole
};
});
currentSelectedRoleOption = this.roleOptions.filter(item => item.isSelected)[0];
currentSelectedRoleOption = this.roleOptions.filter(item => item.isSelected)[0] || { // `|| {...}`: to be compatible with old data(roles not in the present `availableRoles`
value: curRole,
text: this.translateRole(curRole),
isSelected: true
};
}

let currentSelectedInstOption;
Expand Down

0 comments on commit 825b3c3

Please sign in to comment.