Skip to content

Commit

Permalink
Merge pull request #659 from Iterable/anelson/fix-start-embedded-impr…
Browse files Browse the repository at this point in the history
…ession

Fix Start Embedded Impression duplicates
  • Loading branch information
anlinguist authored Jul 20, 2023
2 parents e7b7c09 + 6e4e280 commit 51dcbbd
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 51dcbbd

Please sign in to comment.