Skip to content

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

fix: clear selection if modal is closed through cancel button and secrets have been moved

Scott Wilsona90353744176
diff --git a/frontend/src/pages/secret-manager/OverviewPage/components/SelectionPanel/components/MoveSecretsDialog/MoveSecretsDialog.tsx b/frontend/src/pages/secret-manager/OverviewPage/components/SelectionPanel/components/MoveSecretsDialog/MoveSecretsDialog.tsx
index 5068fd441e..21c0f15882 100644
--- a/frontend/src/pages/secret-manager/OverviewPage/components/SelectionPanel/components/MoveSecretsDialog/MoveSecretsDialog.tsx
+++ b/frontend/src/pages/secret-manager/OverviewPage/components/SelectionPanel/components/MoveSecretsDialog/MoveSecretsDialog.tsx
@@ -1,4 +1,4 @@
-import { useMemo, useState } from "react";
+import { useEffect, useMemo, useState } from "react";
import { SingleValue } from "react-select";
import { subject } from "@casl/ability";
import { IconDefinition } from "@fortawesome/free-brands-svg-icons";
@@ -236,6 +236,12 @@ const Content = ({
setMoveResults(results);
};
+ useEffect(() => {
+ return () => {
+ if (moveResults) onComplete();
+ };
+ }, [moveResults]);
+
if (moveResults) {
return (
<div className="w-full">