File tree Expand file tree Collapse file tree 2 files changed +7
-4
lines changed
src/Common/DeleteComponentModal Expand file tree Collapse file tree 2 files changed +7
-4
lines changed Original file line number Diff line number Diff line change 14
14
* limitations under the License.
15
15
*/
16
16
17
- import React , { useState } from 'react'
17
+ import { useState } from 'react'
18
18
import { useHistory } from 'react-router-dom'
19
19
import info from '../../Assets/Icon/ic-info-filled.svg'
20
20
import { ConfirmationDialog , DeleteDialog } from '../Dialogs'
@@ -42,7 +42,7 @@ const DeleteComponent = ({
42
42
const { push } = useHistory ( )
43
43
44
44
async function handleDelete ( ) {
45
- setDeleting ( true )
45
+ setDeleting ?. ( true )
46
46
setIsDeleting ( true )
47
47
try {
48
48
await deleteComponent ( payload )
@@ -66,7 +66,7 @@ const DeleteComponent = ({
66
66
showError ( serverError )
67
67
}
68
68
} finally {
69
- setDeleting ( false )
69
+ setDeleting ?. ( false )
70
70
setIsDeleting ( false )
71
71
}
72
72
}
Original file line number Diff line number Diff line change 15
15
*/
16
16
17
17
export interface DeleteComponentProps {
18
- setDeleting : ( boolean ) => void
18
+ /**
19
+ * @deprecated - Delete component internally handles loading for the `Delete Button`.
20
+ */
21
+ setDeleting ?: ( boolean ) => void
19
22
toggleConfirmation : any
20
23
deleteComponent : ( any ) => Promise < any >
21
24
title : string
You can’t perform that action at this time.
0 commit comments