@@ -32,11 +32,11 @@ type InterceptorConfigComponent = React.ComponentType<{
32
32
// with no side effects except check for updated interceptor state afterwards.
33
33
activateInterceptor : ( activationOptions ?: any ) => Promise < any > ,
34
34
// 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 ,
37
37
// This should be called when each activation is considered successfully completed. If
38
38
// 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 ,
40
40
// This should be called to hide the custom UI again. Mainly useful if interception is cancelled,
41
41
// or the UI deems itself unnecessary. The UI is never closed automatically, but reportSuccess
42
42
// without showRequests false will jump to the View page, giving similar results.
@@ -282,11 +282,13 @@ export class InterceptOption extends React.Component<InterceptOptionProps> {
282
282
</ InterceptOptionCard > ;
283
283
}
284
284
285
- onActivationStarted = ( ) => {
285
+ onActivationStarted = ( options : { idSuffix ?: string } = { } ) => {
286
286
trackEvent ( {
287
287
category : 'Interceptors' ,
288
288
action : 'Activated' ,
289
- value : this . props . interceptor . id
289
+ value : options . idSuffix
290
+ ? `${ this . props . interceptor . id } -${ options . idSuffix } `
291
+ : this . props . interceptor . id
290
292
} ) ;
291
293
} ;
292
294
@@ -296,12 +298,15 @@ export class InterceptOption extends React.Component<InterceptOptionProps> {
296
298
} ;
297
299
298
300
onActivationSuccessful = ( options : {
299
- showRequests ?: boolean
301
+ showRequests ?: boolean ,
302
+ idSuffix ?: string
300
303
} = { } ) => {
301
304
trackEvent ( {
302
305
category : 'Interceptors' ,
303
306
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
305
310
} ) ;
306
311
307
312
// Some interceptors don't switch to show the requests, e.g. if the UI shows a list
0 commit comments