@@ -32,11 +32,11 @@ type InterceptorConfigComponent = React.ComponentType<{
3232 // with no side effects except check for updated interceptor state afterwards.
3333 activateInterceptor : ( activationOptions ?: any ) => Promise < any > ,
3434 // This should be called when each activation is considered started (i.e. after any required
35- // user input or confirmation).
36- reportStarted : ( ) => void ,
35+ // user input or confirmation). Id suffix can be specified to distinguish activation types.
36+ reportStarted : ( options ?: { idSuffix ?: string } ) => void ,
3737 // This should be called when each activation is considered successfully completed. If
3838 // showRequests is not explicitly set to false, it will jump to the View page.
39- reportSuccess : ( options ?: { showRequests ?: boolean } ) => void ,
39+ reportSuccess : ( options ?: { showRequests ?: boolean , idSuffix ?: string } ) => void ,
4040 // This should be called to hide the custom UI again. Mainly useful if interception is cancelled,
4141 // or the UI deems itself unnecessary. The UI is never closed automatically, but reportSuccess
4242 // without showRequests false will jump to the View page, giving similar results.
@@ -282,11 +282,13 @@ export class InterceptOption extends React.Component<InterceptOptionProps> {
282282 </ InterceptOptionCard > ;
283283 }
284284
285- onActivationStarted = ( ) => {
285+ onActivationStarted = ( options : { idSuffix ?: string } = { } ) => {
286286 trackEvent ( {
287287 category : 'Interceptors' ,
288288 action : 'Activated' ,
289- value : this . props . interceptor . id
289+ value : options . idSuffix
290+ ? `${ this . props . interceptor . id } -${ options . idSuffix } `
291+ : this . props . interceptor . id
290292 } ) ;
291293 } ;
292294
@@ -296,12 +298,15 @@ export class InterceptOption extends React.Component<InterceptOptionProps> {
296298 } ;
297299
298300 onActivationSuccessful = ( options : {
299- showRequests ?: boolean
301+ showRequests ?: boolean ,
302+ idSuffix ?: string
300303 } = { } ) => {
301304 trackEvent ( {
302305 category : 'Interceptors' ,
303306 action : 'Successfully Activated' ,
304- value : this . props . interceptor . id
307+ value : options . idSuffix
308+ ? `${ this . props . interceptor . id } -${ options . idSuffix } `
309+ : this . props . interceptor . id
305310 } ) ;
306311
307312 // Some interceptors don't switch to show the requests, e.g. if the UI shows a list
0 commit comments