@@ -6,7 +6,7 @@ import { getExitActivityKey } from 'components/flow/exit/helpers';
66import Loading from 'components/loading/Loading' ;
77import { fakePropType } from 'config/ConfigProvider' ;
88import { Cancel , getRecentMessages } from 'external' ;
9- import { Category , Exit , FlowNode , LocalizationMap } from 'flowTypes' ;
9+ import { Category , Exit , FlowNode , LocalizationMap , StartFlowExitNames } from 'flowTypes' ;
1010import * as React from 'react' ;
1111import { connect } from 'react-redux' ;
1212import { bindActionCreators } from 'redux' ;
@@ -252,7 +252,17 @@ export class ExitComp extends React.PureComponent<ExitProps, ExitState> {
252252 }
253253 }
254254
255- public getName ( ) : { name : string ; localized ?: boolean } {
255+ public getName ( ) : { name : string ; localized ?: boolean ; disabled ?: boolean } {
256+ let disabled = false ;
257+ if (
258+ this . props . categories &&
259+ this . props . categories . some (
260+ ( category : Category ) => category . name === StartFlowExitNames . Expired
261+ )
262+ ) {
263+ disabled = true ;
264+ }
265+
256266 if ( this . props . translating ) {
257267 let name = '' ;
258268 let delim = '' ;
@@ -272,15 +282,16 @@ export class ExitComp extends React.PureComponent<ExitProps, ExitState> {
272282 delim = ', ' ;
273283 } ) ;
274284
275- return { name, localized } ;
285+ return { name, localized, disabled } ;
276286 } else {
277287 const names : string [ ] = [ ] ;
278288 this . props . categories . forEach ( ( cat : Category ) => {
279289 names . push ( cat . name ) ;
280290 } ) ;
281291
282292 return {
283- name : names . join ( ', ' )
293+ name : names . join ( ', ' ) ,
294+ disabled
284295 } ;
285296 }
286297 }
@@ -389,7 +400,7 @@ export class ExitComp extends React.PureComponent<ExitProps, ExitState> {
389400 }
390401
391402 public render ( ) : JSX . Element {
392- const { name, localized } = this . getName ( ) ;
403+ const { name, localized, disabled } = this . getName ( ) ;
393404
394405 const nameStyle = name ? styles . name : '' ;
395406 const connected = this . props . exit . destination_uuid ? ' jtk-connected' : '' ;
@@ -411,7 +422,8 @@ export class ExitComp extends React.PureComponent<ExitProps, ExitState> {
411422 [ styles . translating ] : this . props . translating ,
412423 [ styles . unnamed_exit ] : name == null ,
413424 [ styles . missing_localization ] : name && this . props . translating && ! localized ,
414- [ styles . confirm_delete ] : confirmDelete
425+ [ styles . confirm_delete ] : confirmDelete ,
426+ [ styles . disabled ] : disabled
415427 } ) ;
416428
417429 const activity = this . getSegmentCount ( ) ;
0 commit comments