[v9.5.x] Auth: Fix set basicrole to the previous role in UI on error from backend (#74511)

Auth: Fix set basicrole to the previous role in UI on error from backend (#74395)

fix: onchange effect to set basicrole when error from backend
(cherry picked from commit 87e8b654a2)

Co-authored-by: Eric Leijonmarck <eric.leijonmarck@gmail.com>
This commit is contained in:
grafana-delivery-bot[bot]
2023-09-07 11:53:08 +03:00
committed by GitHub
co-authored by Eric Leijonmarck
parent ff8fbd0b63
commit 6285daa89b
@@ -49,7 +49,7 @@ export const RolePicker = ({
useEffect(() => {
setSelectedBuiltInRole(basicRole);
setSelectedRoles(appliedRoles);
}, [appliedRoles, basicRole]);
}, [appliedRoles, basicRole, onBasicRoleChange]);
useEffect(() => {
const dimensions = ref?.current?.getBoundingClientRect();