diff --git a/apps/renterd/components/Keys/KeysBatchMenu/KeysBatchDelete.tsx b/apps/renterd/components/Keys/KeysBatchMenu/KeysBatchDelete.tsx index 6d0433cec..1fd8c5bb9 100644 --- a/apps/renterd/components/Keys/KeysBatchMenu/KeysBatchDelete.tsx +++ b/apps/renterd/components/Keys/KeysBatchMenu/KeysBatchDelete.tsx @@ -15,15 +15,11 @@ import { useDialog } from '../../../contexts/dialog' import { useKeys } from '../../../contexts/keys' export function KeysBatchDelete() { - const { selectionMap, deselect } = useKeys() + const { multiSelect } = useKeys() - const ids = useMemo( - () => Object.entries(selectionMap).map(([_, item]) => item.id), - [selectionMap] - ) const keys = useMemo( - () => Object.entries(selectionMap).map(([_, item]) => item.key), - [selectionMap] + () => Object.entries(multiSelect.selectionMap).map(([_, item]) => item.key), + [multiSelect.selectionMap] ) const { openConfirmDialog } = useDialog() const settingsS3 = useSettingsS3() @@ -43,13 +39,13 @@ export function KeysBatchDelete() { }, }, }) - deselect(ids) + multiSelect.deselectAll() if (response.error) { triggerErrorToast({ title: 'Error deleting keys', body: response.error }) } else { triggerSuccessToast({ title: `Keys deleted` }) } - }, [settingsS3.data, settingsS3Update, deselect, keys, ids]) + }, [settingsS3.data, settingsS3Update, multiSelect, keys]) return (