@@ -20,7 +20,7 @@ export function impressionsTrackerFactory(
20
20
telemetryCache ?: ITelemetryCacheSync | ITelemetryCacheAsync ,
21
21
) : IImpressionsTracker {
22
22
23
- const { log, impressionListener , runtime : { ip, hostname } , version } = settings ;
23
+ const { log, runtime : { ip, hostname } , version } = settings ;
24
24
25
25
return {
26
26
track ( impressions : ImpressionDecorated [ ] , attributes ?: SplitIO . Attributes ) {
@@ -56,7 +56,7 @@ export function impressionsTrackerFactory(
56
56
}
57
57
58
58
// @TODO next block might be handled by the integration manager. In that case, the metadata object doesn't need to be passed in the constructor
59
- if ( impressionListener || integrationsManager ) {
59
+ if ( settings . impressionListener || integrationsManager ) {
60
60
for ( let i = 0 ; i < impressionsLength ; i ++ ) {
61
61
const impressionData : SplitIO . ImpressionData = {
62
62
// copy of impression, to avoid unexpected behavior if modified by integrations or impressionListener
@@ -74,7 +74,7 @@ export function impressionsTrackerFactory(
74
74
if ( integrationsManager ) integrationsManager . handleImpression ( impressionData ) ;
75
75
76
76
try { // @ts -ignore. An exception on the listeners should not break the SDK.
77
- if ( impressionListener ) impressionListener . logImpression ( impressionData ) ;
77
+ if ( settings . impressionListener ) settings . impressionListener . logImpression ( impressionData ) ;
78
78
} catch ( err ) {
79
79
log . error ( ERROR_IMPRESSIONS_LISTENER , [ err ] ) ;
80
80
}
0 commit comments