Skip to content

Commit

Permalink
don't allow tracking an embedded impression if it's already being tra…
Browse files Browse the repository at this point in the history
…cked
  • Loading branch information
anlinguist committed Jul 12, 2023
1 parent e7b7c09 commit 6e4e280
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions swift-sdk/Internal/EmbeddedSessionManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,9 @@ public class EmbeddedSessionManager {
}

public func startImpression(messageId: String) {
if let trackingImpression = currentlyTrackingImpressions[messageId], trackingImpression.tracking {
return
}
if let _ = currentlyTrackingImpressions[messageId] {
if let index = session?.impressions.firstIndex(where: { $0.messageId == messageId }) {
session?.impressions[index].displayCount += 1
Expand Down

0 comments on commit 6e4e280

Please sign in to comment.