From 988ab1c6830611312ffe09dfc98025824fe7ff3c Mon Sep 17 00:00:00 2001 From: Carter Date: Thu, 24 Apr 2025 14:48:32 -0600 Subject: [PATCH] remove callback works now haha lol --- src/group/GroupActions.tsx | 4 +++- src/group/GroupSettings.tsx | 2 +- src/pages/Devices.tsx | 12 +----------- 3 files changed, 5 insertions(+), 13 deletions(-) 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