diff --git a/frontend/src/pages/secret-manager/SecretDashboardPage/components/SecretListView/SecretListView.tsx b/frontend/src/pages/secret-manager/SecretDashboardPage/components/SecretListView/SecretListView.tsx index 706f3f53e..3a89a58ab 100644 --- a/frontend/src/pages/secret-manager/SecretDashboardPage/components/SecretListView/SecretListView.tsx +++ b/frontend/src/pages/secret-manager/SecretDashboardPage/components/SecretListView/SecretListView.tsx @@ -180,10 +180,12 @@ export const SecretListView = ({ try { // personal secret change + let personalAction = false; if (overrideAction === "deleted") { await handleSecretOperation("delete", SecretType.Personal, oldKey, { secretId: orgSecret.idOverride }); + personalAction = true; } else if (overrideAction && idOverride) { await handleSecretOperation("update", SecretType.Personal, oldKey, { value: valueOverride, @@ -191,14 +193,16 @@ export const SecretListView = ({ secretId: orgSecret.idOverride, skipMultilineEncoding: modSecret.skipMultilineEncoding }); + personalAction = true; } else if (overrideAction) { await handleSecretOperation("create", SecretType.Personal, oldKey, { value: valueOverride }); + personalAction = true; } // shared secret change - if (!isSharedSecUnchanged) { + if (!isSharedSecUnchanged && !personalAction) { await handleSecretOperation("update", SecretType.Shared, oldKey, { value, tags: tagIds, @@ -232,10 +236,11 @@ export const SecretListView = ({ }); handlePopUpClose("secretDetail"); createNotification({ - type: isProtectedBranch ? "info" : "success", - text: isProtectedBranch - ? "Requested changes have been sent for review" - : "Successfully saved secrets" + type: isProtectedBranch && !personalAction ? "info" : "success", + text: + isProtectedBranch && !personalAction + ? "Requested changes have been sent for review" + : "Successfully saved secrets" }); } catch (error) { console.log(error); @@ -283,7 +288,12 @@ export const SecretListView = ({ text: "Failed to delete secret" }); } - }, [(popUp.deleteSecret?.data as SecretV3RawSanitized)?.key, environment, secretPath]); + }, [ + (popUp.deleteSecret?.data as SecretV3RawSanitized)?.key, + environment, + secretPath, + isProtectedBranch + ]); // for optimization on minimise re-rendering of secret items const onCreateTag = useCallback(() => handlePopUpOpen("createTag"), []);