11import { getCurrentHub } from '@sentry/core' ;
22import type { Integration } from '@sentry/types' ;
3- import { isNodeEnv , logger } from '@sentry/utils' ;
3+ import { isBrowser } from '@sentry/utils' ;
4+ import { logger } from '@sentry/utils' ;
45
56import {
67 ACTOR_LABEL ,
@@ -25,20 +26,6 @@ import { createDialogStyles } from './widget/Dialog.css';
2526import { createMainStyles } from './widget/Main.css' ;
2627import { SuccessMessage } from './widget/SuccessMessage' ;
2728
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-
4229interface FeedbackConfiguration extends Partial < Omit < FeedbackConfigurationWithDefaults , 'theme' > > {
4330 theme ?: {
4431 dark ?: Partial < FeedbackTheme > ;
@@ -271,7 +258,7 @@ export class Feedback implements Integration {
271258
272259 const userKey = this . options . useSentryUser ;
273260 const scope = getCurrentHub ( ) . getScope ( ) ;
274- const user = scope && scope . getUser ( ) ;
261+ const user = scope . getUser ( ) ;
275262
276263 this . _dialog = Dialog ( {
277264 defaultName : ( userKey && user && user [ userKey . name ] ) || '' ,
0 commit comments