File tree Expand file tree Collapse file tree 1 file changed +5
-6
lines changed
packages/browser/src/integration Expand file tree Collapse file tree 1 file changed +5
-6
lines changed Original file line number Diff line number Diff line change @@ -6,11 +6,6 @@ import {
66import { ExperimentUser } from '../types/user' ;
77import { safeGlobal } from '../util/global' ;
88
9- declare global {
10- // eslint-disable-next-line no-var, @typescript-eslint/no-explicit-any
11- var amplitude : any ;
12- }
13-
149type AmplitudeIdentify = {
1510 set ( property : string , value : unknown ) : void ;
1611 unset ( property : string ) : void ;
@@ -101,9 +96,13 @@ export class AmplitudeAnalyticsProvider implements ExperimentAnalyticsProvider {
10196 }
10297
10398 unsetUserProperty ( event : ExperimentAnalyticsEvent ) : void {
99+ const amplitude = safeGlobal [ 'amplitude' ] ;
100+ if ( ! amplitude ) {
101+ return ;
102+ }
104103 // if the variant does not have a value, unset the user property
105104 this . amplitudeInstance . identify (
106- new safeGlobal . amplitude . Identify ( ) . unset ( event . userProperty ) ,
105+ new amplitude . Identify ( ) . unset ( event . userProperty ) ,
107106 ) ;
108107 }
109108}
You can’t perform that action at this time.
0 commit comments