Skip to content
Snippets Groups Projects
Commit 120af6c0 authored by Arie Peterson's avatar Arie Peterson
Browse files

Merge branch '116-react-check-for-admin-access-breaks-sometimes' into 'main'

Resolve "React check for admin access breaks sometimes"

Closes #116

See merge request !169
parents 76fac34a e78fe296
No related branches found
No related tags found
1 merge request!169Resolve "React check for admin access breaks sometimes"
Pipeline #44226 passed with stages
in 3 minutes and 52 seconds
...@@ -94,9 +94,15 @@ export const UserModal = ({ open, onClose, userId, setUserId, apps }: UserModalP ...@@ -94,9 +94,15 @@ export const UserModal = ({ open, onClose, userId, setUserId, apps }: UserModalP
// }; // };
}, [user, reset, open]); }, [user, reset, open]);
let dashboardIndex = 0;
apps.forEach((app, index) => {
if (app.name === 'dashboard') {
dashboardIndex = index;
}
});
const dashboardRole = useWatch({ const dashboardRole = useWatch({
control, control,
name: 'app_roles.0.role', name: `app_roles.${dashboardIndex}.role`,
}); });
useEffect(() => { useEffect(() => {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment