1
1
import { getCurrentHub } from '@sentry/core' ;
2
2
import type { Integration } from '@sentry/types' ;
3
- import { isNodeEnv , logger } from '@sentry/utils' ;
3
+ import { isBrowser } from '@sentry/utils' ;
4
+ import { logger } from '@sentry/utils' ;
4
5
5
6
import {
6
7
ACTOR_LABEL ,
@@ -25,20 +26,6 @@ import { createDialogStyles } from './widget/Dialog.css';
25
26
import { createMainStyles } from './widget/Main.css' ;
26
27
import { SuccessMessage } from './widget/SuccessMessage' ;
27
28
28
- type ElectronProcess = { type ?: string } ;
29
-
30
- // Electron renderers with nodeIntegration enabled are detected as Node.js so we specifically test for them
31
- function isElectronNodeRenderer ( ) : boolean {
32
- return typeof process !== 'undefined' && ( process as ElectronProcess ) . type === 'renderer' ;
33
- }
34
- /**
35
- * Returns true if we are in the browser.
36
- */
37
- function isBrowser ( ) : boolean {
38
- // eslint-disable-next-line no-restricted-globals
39
- return typeof window !== 'undefined' && ( ! isNodeEnv ( ) || isElectronNodeRenderer ( ) ) ;
40
- }
41
-
42
29
interface FeedbackConfiguration extends Partial < Omit < FeedbackConfigurationWithDefaults , 'theme' > > {
43
30
theme ?: {
44
31
dark ?: Partial < FeedbackTheme > ;
@@ -271,7 +258,7 @@ export class Feedback implements Integration {
271
258
272
259
const userKey = this . options . useSentryUser ;
273
260
const scope = getCurrentHub ( ) . getScope ( ) ;
274
- const user = scope && scope . getUser ( ) ;
261
+ const user = scope . getUser ( ) ;
275
262
276
263
this . _dialog = Dialog ( {
277
264
defaultName : ( userKey && user && user [ userKey . name ] ) || '' ,
0 commit comments