File tree Expand file tree Collapse file tree 2 files changed +4
-7
lines changed
src/Shared/Components/ConfirmationModal Expand file tree Collapse file tree 2 files changed +4
-7
lines changed Original file line number Diff line number Diff line change 17
17
import React , { useState } from 'react'
18
18
import { ToastManager , ToastVariantType } from '@Shared/Services/ToastManager'
19
19
import { ServerErrors } from '@Common/ServerError'
20
- import { showError } from '@Common/Helper'
20
+ import { showError , stopPropagation } from '@Common/Helper'
21
21
import { ConfirmationModalVariantType , DeleteConfirmationModalProps } from './types'
22
22
import ConfirmationModal from './ConfirmationModal'
23
23
import { CannotDeleteModal } from './CannotDeleteModal'
@@ -47,7 +47,9 @@ export const DeleteConfirmationModal: React.FC<DeleteConfirmationModalProps> = (
47
47
const [ isLoading , setLoading ] = useState ( isDeleting )
48
48
49
49
const handleDelete = async ( e : React . MouseEvent < HTMLButtonElement > ) => {
50
- e . stopPropagation ( )
50
+ if ( e ) {
51
+ stopPropagation ( e )
52
+ }
51
53
52
54
setLoading ( true )
53
55
try {
@@ -57,7 +59,6 @@ export const DeleteConfirmationModal: React.FC<DeleteConfirmationModalProps> = (
57
59
description : successToastMessage || 'Successfully deleted' ,
58
60
} )
59
61
setLoading ( false )
60
-
61
62
closeConfirmationModal ( )
62
63
} catch ( serverError ) {
63
64
if ( serverError instanceof ServerErrors && serverError . code === errorCodeToShowCannotDeleteDialog ) {
Original file line number Diff line number Diff line change @@ -154,10 +154,6 @@ export interface DeleteConfirmationModalProps
154
154
*/
155
155
onError ?: ( error ) => void
156
156
// Additional Configuration
157
- /**
158
- * Boolean to determine if event propagation should be stopped.
159
- */
160
- shouldStopPropagation ?: boolean
161
157
/**
162
158
* Boolean to disable the delete action.
163
159
*/
You can’t perform that action at this time.
0 commit comments