diff --git a/src/group/GroupActions.tsx b/src/group/GroupActions.tsx index e86f127..65c6f42 100644 --- a/src/group/GroupActions.tsx +++ b/src/group/GroupActions.tsx @@ -47,11 +47,12 @@ interface Props { devices: Device[]; permissions: pond.Permission[]; refreshCallback: () => void; + removeCallback?: () => void; } export default function GroupActions(props: Props) { const classes = useStyles(); - const { group, permissions, refreshCallback, devices } = props; + const { group, permissions, refreshCallback, devices, removeCallback } = props; const [anchorEl, setAnchorEl] = useState(null); const [groupSettingsOpen, setGroupSettingsOpen] = useState(false); const [shareOpen, setShareOpen] = useState(false); @@ -142,6 +143,7 @@ export default function GroupActions(props: Props) { isDialogOpen={groupSettingsOpen} refreshCallback={refreshCallback} closeDialogCallback={() => setGroupSettingsOpen(false)} + removeGroupCallback={removeCallback} groupDevices={devices} /> { console.log("Updating removeCallbackRef with:", removeGroupCallback); - removeCallbackRef.current = removeGroupCallback; + if (removeGroupCallback) removeCallbackRef.current = removeGroupCallback; }, [removeGroupCallback]); useEffect(() => { diff --git a/src/pages/Devices.tsx b/src/pages/Devices.tsx index 3d6dbe3..d9a843d 100644 --- a/src/pages/Devices.tsx +++ b/src/pages/Devices.tsx @@ -492,23 +492,13 @@ export default function Devices() { onRowClick={toDevice} setSearchText={setSearch} isLoading={devicesLoading} - actions={getGroup() && } + actions={getGroup() && } /> - ) } \ No newline at end of file