Resolt problema amb versió síncrona
This commit is contained in:
parent
182c1025ac
commit
6efa6956d7
@ -212,7 +212,7 @@ const U = ({u, esAdministrador, setUsrSeleccionat}) => {
|
|||||||
// zIndex: `200`
|
// zIndex: `200`
|
||||||
// }}
|
// }}
|
||||||
// // onMouseLeave={ev => {
|
// // onMouseLeave={ev => {
|
||||||
// // setMostraMenu(false);
|
// // setMostraMenu(false);p
|
||||||
// // }}
|
// // }}
|
||||||
// >
|
// >
|
||||||
// {/* <Link to="/c/config"> */}
|
// {/* <Link to="/c/config"> */}
|
||||||
@ -453,20 +453,21 @@ export const Usuaris = () => {
|
|||||||
// const [ambitsUSel, setAmbitsUSel] = useState([]);
|
// const [ambitsUSel, setAmbitsUSel] = useState([]);
|
||||||
// (async () => {
|
// (async () => {
|
||||||
|
|
||||||
let ambitsUSel = [];
|
// let ambitsUSel = [];
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
(async () => {
|
(async () => {
|
||||||
const comprovaAdmin = await Roles.userIsInRoleAsync(userId, ["admin"]);
|
const comprovaAdmin = await Roles.userIsInRoleAsync(userId, ["admin"]);
|
||||||
setEsEditor(comprovaAdmin);
|
setEsEditor(comprovaAdmin);
|
||||||
|
|
||||||
const ambits = await Roles.getScopesForUserAsync(usrSeleccionat?._id);
|
|
||||||
setAmbitsUSel(ambits);
|
|
||||||
// console.log("ambitsUSel: ", ambitsUSel);
|
// console.log("ambitsUSel: ", ambitsUSel);
|
||||||
})();
|
})();
|
||||||
|
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
|
const ambitsUSel = Roles.getScopesForUser(usrSeleccionat?._id);
|
||||||
|
// setAmbitsUSel(ambits);
|
||||||
|
|
||||||
|
|
||||||
const rols = useTracker("rols", async () => {
|
const rols = useTracker("rols", async () => {
|
||||||
return await Roles.getRolesForUserAsync(usrSeleccionat?._id);
|
return await Roles.getRolesForUserAsync(usrSeleccionat?._id);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user