@@ -81,6 +81,7 @@ export class Feedback implements Integration {
81
81
private hasDialogEverOpened : boolean ;
82
82
83
83
public constructor ( {
84
+ id = 'sentry-feedback' ,
84
85
attachTo = null ,
85
86
autoInject = true ,
86
87
showEmail = true ,
@@ -123,6 +124,7 @@ export class Feedback implements Integration {
123
124
this . hasDialogEverOpened = false ;
124
125
125
126
this . options = {
127
+ id,
126
128
attachTo,
127
129
autoInject,
128
130
isAnonymous,
@@ -174,7 +176,7 @@ export class Feedback implements Integration {
174
176
if ( this . _host ) {
175
177
this . remove ( ) ;
176
178
}
177
- const existingFeedback = document . querySelector ( '#sentry-feedback' ) ;
179
+ const existingFeedback = document . querySelector ( `# ${ this . options . id } ` ) ;
178
180
if ( existingFeedback ) {
179
181
existingFeedback . remove ( ) ;
180
182
}
@@ -237,8 +239,8 @@ export class Feedback implements Integration {
237
239
if ( this . _dialog ) {
238
240
this . _dialog . open ( ) ;
239
241
this . _isDialogOpen = true ;
240
- if ( this . options . onDialogOpened ) {
241
- this . options . onDialogOpened ( ) ;
242
+ if ( this . options . onDialogOpen ) {
243
+ this . options . onDialogOpen ( ) ;
242
244
}
243
245
return ;
244
246
}
@@ -278,8 +280,8 @@ export class Feedback implements Integration {
278
280
this . _actor && this . _actor . hide ( ) ;
279
281
280
282
this . hasDialogEverOpened = true ;
281
- if ( this . options . onDialogOpened ) {
282
- this . options . onDialogOpened ( ) ;
283
+ if ( this . options . onDialogOpen ) {
284
+ this . options . onDialogOpen ( ) ;
283
285
}
284
286
} catch ( err ) {
285
287
// TODO: Error handling?
@@ -334,7 +336,7 @@ export class Feedback implements Integration {
334
336
335
337
// Create the host
336
338
this . _host = document . createElement ( 'div' ) ;
337
- this . _host . id = 'sentry-feedback' ;
339
+ this . _host . id = this . options . id ;
338
340
339
341
// Create the shadow root
340
342
const shadow = this . _host . attachShadow ( { mode : 'open' } ) ;
0 commit comments