File tree Expand file tree Collapse file tree 1 file changed +20
-3
lines changed
redisinsight/ui/src/pages/home/components/form Expand file tree Collapse file tree 1 file changed +20
-3
lines changed Original file line number Diff line number Diff line change @@ -19,7 +19,8 @@ import PopoverDelete from 'uiSrc/pages/browser/components/popover-delete/Popover
19
19
20
20
import {
21
21
ADD_NEW_CA_CERT ,
22
- NO_CA_CERT
22
+ NO_CA_CERT ,
23
+ ADD_NEW ,
23
24
} from 'uiSrc/pages/home/constants'
24
25
import { DbConnectionInfo } from 'uiSrc/pages/home/interfaces'
25
26
import { TelemetryEvent , sendEventTelemetry } from 'uiSrc/telemetry'
@@ -43,11 +44,27 @@ const TlsDetails = (props: Props) => {
43
44
const [ activeCertId , setActiveCertId ] = useState < Nullable < string > > ( null )
44
45
45
46
const handleDeleteCaCert = ( id : string ) => {
46
- dispatch ( deleteCaCertificateAction ( id , ( ) => handleClickDeleteCert ( 'CA' ) ) )
47
+ dispatch ( deleteCaCertificateAction ( id , ( ) => {
48
+ if ( formik . values . selectedCaCertName === id ) {
49
+ formik . setFieldValue (
50
+ 'selectedCaCertName' ,
51
+ NO_CA_CERT ,
52
+ )
53
+ }
54
+ handleClickDeleteCert ( 'CA' )
55
+ } ) )
47
56
}
48
57
49
58
const handleDeleteClientCert = ( id : string ) => {
50
- dispatch ( deleteClientCertAction ( id , ( ) => handleClickDeleteCert ( 'Client' ) ) )
59
+ dispatch ( deleteClientCertAction ( id , ( ) => {
60
+ if ( formik . values . selectedTlsClientCertId === id ) {
61
+ formik . setFieldValue (
62
+ 'selectedTlsClientCertId' ,
63
+ ADD_NEW ,
64
+ )
65
+ }
66
+ handleClickDeleteCert ( 'Client' )
67
+ } ) )
51
68
}
52
69
53
70
const handleClickDeleteCert = ( certificateType : 'Client' | 'CA' ) => {
You can’t perform that action at this time.
0 commit comments