1
1
import { getCurrentHub } from '@sentry/core' ;
2
2
import type { Integration } from '@sentry/types' ;
3
3
import { isNodeEnv , logger } from '@sentry/utils' ;
4
- import { ACTOR_LABEL , CANCEL_BUTTON_LABEL , DEFAULT_THEME , EMAIL_LABEL , EMAIL_PLACEHOLDER , FORM_TITLE , MESSAGE_LABEL , MESSAGE_PLACEHOLDER , NAME_LABEL , NAME_PLACEHOLDER , SUBMIT_BUTTON_LABEL , SUCCESS_MESSAGE_TEXT } from './constants' ;
5
4
5
+ import {
6
+ ACTOR_LABEL ,
7
+ CANCEL_BUTTON_LABEL ,
8
+ DEFAULT_THEME ,
9
+ EMAIL_LABEL ,
10
+ EMAIL_PLACEHOLDER ,
11
+ FORM_TITLE ,
12
+ MESSAGE_LABEL ,
13
+ MESSAGE_PLACEHOLDER ,
14
+ NAME_LABEL ,
15
+ NAME_PLACEHOLDER ,
16
+ SUBMIT_BUTTON_LABEL ,
17
+ SUCCESS_MESSAGE_TEXT ,
18
+ } from './constants' ;
6
19
import type { FeedbackConfigurationWithDefaults , FeedbackFormData , FeedbackTheme } from './types' ;
7
20
import { handleFeedbackSubmit } from './util/handleFeedbackSubmit' ;
8
21
import { Actor } from './widget/Actor' ;
@@ -30,7 +43,7 @@ interface FeedbackConfiguration extends Partial<Omit<FeedbackConfigurationWithDe
30
43
theme ?: {
31
44
dark ?: Partial < FeedbackTheme > ;
32
45
light ?: Partial < FeedbackTheme > ;
33
- }
46
+ } ;
34
47
}
35
48
36
49
/**
@@ -78,7 +91,7 @@ export class Feedback implements Integration {
78
91
/**
79
92
* Tracks if dialog has ever been opened at least one time
80
93
*/
81
- private hasDialogEverOpened : boolean ;
94
+ private _hasDialogEverOpened : boolean ;
82
95
83
96
public constructor ( {
84
97
id = 'sentry-feedback' ,
@@ -113,15 +126,15 @@ export class Feedback implements Integration {
113
126
onDialogOpen,
114
127
onSubmitError,
115
128
onSubmitSuccess,
116
- } : FeedbackConfiguration = { } ) {
129
+ } : FeedbackConfiguration = { } ) {
117
130
// Initializations
118
131
this . name = Feedback . id ;
119
132
this . _actor = null ;
120
133
this . _dialog = null ;
121
134
this . _host = null ;
122
135
this . _shadow = null ;
123
136
this . _isDialogOpen = false ;
124
- this . hasDialogEverOpened = false ;
137
+ this . _hasDialogEverOpened = false ;
125
138
126
139
this . options = {
127
140
id,
@@ -252,7 +265,7 @@ export class Feedback implements Integration {
252
265
}
253
266
254
267
// Lazy-load until dialog is opened and only inject styles once
255
- if ( ! this . hasDialogEverOpened ) {
268
+ if ( ! this . _hasDialogEverOpened ) {
256
269
this . _shadow . appendChild ( createDialogStyles ( document ) ) ;
257
270
}
258
271
@@ -279,7 +292,7 @@ export class Feedback implements Integration {
279
292
// Hides the default actor whenever dialog is opened
280
293
this . _actor && this . _actor . hide ( ) ;
281
294
282
- this . hasDialogEverOpened = true ;
295
+ this . _hasDialogEverOpened = true ;
283
296
if ( this . options . onDialogOpen ) {
284
297
this . options . onDialogOpen ( ) ;
285
298
}
0 commit comments