Skip to content

Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.

fix(agent-vault): drop discard confirmation from Create Session dialog

Scott Wilsonbab9adee2fdf
diff --git a/frontend/src/pages/agent-vault/AgentVaultSessionsPage/components/CreateSessionDialog.tsx b/frontend/src/pages/agent-vault/AgentVaultSessionsPage/components/CreateSessionDialog.tsx
index ac02cd7a15..200a9bdb97 100644
--- a/frontend/src/pages/agent-vault/AgentVaultSessionsPage/components/CreateSessionDialog.tsx
+++ b/frontend/src/pages/agent-vault/AgentVaultSessionsPage/components/CreateSessionDialog.tsx
@@ -12,7 +12,6 @@ import {
DialogFooter,
DialogHeader,
DialogTitle,
- DiscardChangesAlertDialog,
Field,
FieldContent,
FieldDescription,
@@ -25,7 +24,7 @@ import {
SelectTrigger,
SelectValue
} from "@app/components/v3";
-import { useDebounce, useDiscardChangesGuard } from "@app/hooks";
+import { useDebounce } from "@app/hooks";
import {
useCreateAgentVaultSession,
useListAgentVaultAccessBundles
@@ -97,10 +96,6 @@ export const CreateSessionDialog = ({ isOpen, onOpenChange, onCreated }: Props)
const isTtlValid = customTtlError === null;
const visibleTtlError = customTtl.length > 0 ? customTtlError : null;
- const isDirty = Boolean(selectedBundle) || customTtl.length > 0;
- const { confirmDiscard, isDiscardDialogOpen, requestDiscard, setIsDiscardDialogOpen } =
- useDiscardChangesGuard({ isDirty, onDiscard: () => onOpenChange(false) });
-
useEffect(() => {
if (isOpen) {
setSelectedBundle(null);
@@ -126,16 +121,7 @@ export const CreateSessionDialog = ({ isOpen, onOpenChange, onCreated }: Props)
};
return (
- <Dialog
- open={isOpen}
- onOpenChange={(nextOpen) => {
- if (nextOpen) {
- onOpenChange(true);
- return;
- }
- requestDiscard();
- }}
- >
+ <Dialog open={isOpen} onOpenChange={onOpenChange}>
<DialogContent>
<DialogHeader>
<DialogTitle>Create Session</DialogTitle>
@@ -232,7 +218,7 @@ export const CreateSessionDialog = ({ isOpen, onOpenChange, onCreated }: Props)
</div>
<DialogFooter>
- <Button variant="ghost" onClick={requestDiscard}>
+ <Button variant="ghost" onClick={() => onOpenChange(false)}>
Cancel
</Button>
<Button
@@ -244,14 +230,6 @@ export const CreateSessionDialog = ({ isOpen, onOpenChange, onCreated }: Props)
Create Session
</Button>
</DialogFooter>
-
- <DiscardChangesAlertDialog
- open={isDiscardDialogOpen}
- onOpenChange={setIsDiscardDialogOpen}
- onDiscard={confirmDiscard}
- title="Discard Changes?"
- description="The access bundle and expiry you picked will be lost."
- />
</DialogContent>
</Dialog>
);