@@ -20,7 +20,7 @@ export function impressionsTrackerFactory(
2020 telemetryCache ?: ITelemetryCacheSync | ITelemetryCacheAsync ,
2121) : IImpressionsTracker {
2222
23- const { log, impressionListener , runtime : { ip, hostname } , version } = settings ;
23+ const { log, runtime : { ip, hostname } , version } = settings ;
2424
2525 return {
2626 track ( impressions : ImpressionDecorated [ ] , attributes ?: SplitIO . Attributes ) {
@@ -56,7 +56,7 @@ export function impressionsTrackerFactory(
5656 }
5757
5858 // @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 ) {
6060 for ( let i = 0 ; i < impressionsLength ; i ++ ) {
6161 const impressionData : SplitIO . ImpressionData = {
6262 // copy of impression, to avoid unexpected behavior if modified by integrations or impressionListener
@@ -74,7 +74,7 @@ export function impressionsTrackerFactory(
7474 if ( integrationsManager ) integrationsManager . handleImpression ( impressionData ) ;
7575
7676 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 ) ;
7878 } catch ( err ) {
7979 log . error ( ERROR_IMPRESSIONS_LISTENER , [ err ] ) ;
8080 }
0 commit comments