fixed some group permission issues

This commit is contained in:
Carter 2025-02-18 13:36:22 -06:00
parent 6ee7aa95a9
commit 25de677106
7 changed files with 90 additions and 15 deletions

View file

@ -40,11 +40,12 @@ interface Props {
loading?: boolean;
disableAddTag?: boolean;
tags: pond.Tag[];
groupID?: number;
}
export default function DeviceOverview(props: Props) {
const [{ user, firmware }] = useGlobalState();
const { device, components, usage, loading, disableAddTag, tags } = props;
const { device, components, groupID, usage, loading, disableAddTag, tags } = props;
const prevComponents = usePrevious(components);
const { info } = useSnackbar();
const classes = useStyles();
@ -78,8 +79,7 @@ export default function DeviceOverview(props: Props) {
}, [components, prevComponents]);
const pathToDevice = () => {
if (useParams().groupID) {
const groupID = parseInt(useParams().groupID ?? "0", 10);
if (groupID) {
const groupPath: string = groupID > 0 ? "/groups/" + groupID.toString() : "";
const devicePath: string = "/devices/" + device.settings.deviceId.toString();
return groupPath + devicePath;