diff --git a/frontend/components/environments/secrets/HistoryDialog.tsx b/frontend/components/environments/secrets/HistoryDialog.tsx index 7e071e85..27905c89 100644 --- a/frontend/components/environments/secrets/HistoryDialog.tsx +++ b/frontend/components/environments/secrets/HistoryDialog.tsx @@ -235,6 +235,7 @@ export const HistoryDialog = ({ historyItem={historyItem!} index={index} handlePropertyChange={handlePropertyChange} + onRestore={closeModal} /> )} diff --git a/frontend/components/environments/secrets/SecretPropertyDiffs.tsx b/frontend/components/environments/secrets/SecretPropertyDiffs.tsx index 4ee9b2ff..39500fd5 100644 --- a/frontend/components/environments/secrets/SecretPropertyDiffs.tsx +++ b/frontend/components/environments/secrets/SecretPropertyDiffs.tsx @@ -4,14 +4,19 @@ import { FaRedoAlt, FaUndoAlt } from 'react-icons/fa' import { Button } from '../../common/Button' import { Tag } from '../Tag' -export const SecretPropertyDiffs = (props: { +export const SecretPropertyDiffs = ({ + secret, + historyItem, + index, + handlePropertyChange, + onRestore, +}: { secret: SecretType historyItem: SecretEventType index: number handlePropertyChange: Function + onRestore: Function }) => { - const { secret, historyItem, index, handlePropertyChange } = props - const previousItem = secret.history![index - 1]! const getAddedTags = () => { @@ -30,6 +35,7 @@ export const SecretPropertyDiffs = (props: { const handleRestoreValue = (value: string) => { handlePropertyChange(secret.id, 'value', value) + onRestore() } return (