Skip to content

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

@ fix(frontend): clear load-backup dialog state on open to avoid stale content

andrewhuhh66f98f06ebcd
diff --git a/frontend/src/pages/secret-manager/SettingsPage/components/EncryptionTab/EncryptionTab.tsx b/frontend/src/pages/secret-manager/SettingsPage/components/EncryptionTab/EncryptionTab.tsx
index a7074f56a5..762c71fc36 100644
--- a/frontend/src/pages/secret-manager/SettingsPage/components/EncryptionTab/EncryptionTab.tsx
+++ b/frontend/src/pages/secret-manager/SettingsPage/components/EncryptionTab/EncryptionTab.tsx
@@ -137,10 +137,12 @@ const LoadBackupModal = ({
const [backupFileName, setBackupFileName] = useState("");
const handleOpenChange = (state: boolean) => {
- if (!state) {
- setBackupContent("");
- setBackupFileName("");
- }
+ // Clear on every open-change (open and close), not only close: a FileReader
+ // read can finish after the dialog closes and repopulate backupContent, so
+ // clearing on reopen recovers from that stale state (Continue would otherwise
+ // be enabled with no filename shown).
+ setBackupContent("");
+ setBackupFileName("");
onOpenChange(state);
};