fix: ConfirmDialog title shows undefined on exit

chore: remove variable
This commit is contained in:
Nikola Ubavic 2021-12-07 18:08:34 +01:00
parent d292ea4ae3
commit 338c1f85c9

View file

@ -97,7 +97,6 @@ const MachineActions = memo(({ machine, onActionSuccess }) => {
} }
}) })
const confirmDialogOpen = Boolean(action.command)
const disabled = !!(action?.command === 'restartServices' && loadingEvents) const disabled = !!(action?.command === 'restartServices' && loadingEvents)
const machineStatusPreflight = actionToDo => { const machineStatusPreflight = actionToDo => {
@ -193,8 +192,8 @@ const MachineActions = memo(({ machine, onActionSuccess }) => {
</div> </div>
<ConfirmDialog <ConfirmDialog
disabled={disabled} disabled={disabled}
open={confirmDialogOpen} open={action.command}
title={`${action?.display} this machine?`} title={`${action.display} this machine?`}
errorMessage={errorMessage} errorMessage={errorMessage}
toBeConfirmed={machine.name} toBeConfirmed={machine.name}
message={action?.message} message={action?.message}
@ -211,7 +210,7 @@ const MachineActions = memo(({ machine, onActionSuccess }) => {
}) })
}} }}
onDismissed={() => { onDismissed={() => {
setAction({ command: null }) setAction({ display: action.display, command: null })
setErrorMessage(null) setErrorMessage(null)
}} }}
/> />