RolePicker: Only update org role if the value has changed (#51239)

This commit is contained in:
Karl Persson 2022-06-22 14:47:47 +02:00 committed by GitHub
parent f9becc2d4f
commit 454f65cd88
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -106,7 +106,7 @@ export const RolePicker = ({
};
const onUpdate = (newRoles: Role[], newBuiltInRole?: OrgRole) => {
if (onBuiltinRoleChange && newBuiltInRole) {
if (onBuiltinRoleChange && newBuiltInRole && newBuiltInRole !== builtInRole) {
onBuiltinRoleChange(newBuiltInRole);
}
onRolesChange(newRoles);