ok this time i really fixed it

This commit is contained in:
Carter 2025-04-24 12:20:35 -06:00
parent b4c1a543de
commit 29d6f201c8

View file

@ -120,14 +120,15 @@ export default function Devices() {
setGroups(newGroups);
};
const getGroupKey = () => {
return parseInt(tab+1)
const getGroup = () => {
let group = groups[parseInt(tab)]
return group
}
useEffect(() => {
setGroupPermissions([])
if (tab === "all") return
groupAPI.getGroupPermissions(getGroupKey()).then(resp => {
groupAPI.getGroupPermissions(getGroup().id()).then(resp => {
console.log(resp)
setGroupPermissions(resp.data.permissions)
})
@ -160,7 +161,7 @@ export default function Devices() {
if (tab !== "all") {
let keys = getContextKeys()
//keys.splice(keys.length - 1, 0, getGroup().id().toString());
keys.push(getGroupKey().toString());
keys.push(getGroup().id().toString());
return keys
} else {
return getContextKeys()
@ -380,11 +381,6 @@ export default function Devices() {
)
}
const getGroup = () => {
let group = groups[parseInt(tab+1)]
return group
}
const mobile = (row: Device) => {
return (
<Box sx={{ margin: 2 }}>