File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -22,26 +22,29 @@ public class EmbeddedSessionManager {
2222 }
2323
2424 public func endSession( ) {
25- guard session? . isActive == true else {
26- return
27- }
25+
2826 guard let session = session else {
2927 ITBError ( " No current session. " )
3028 return
3129 }
3230
31+ guard session. isActive == true else {
32+ return
33+ }
34+
3335 for messageId in currentlyTrackingImpressions. keys {
3436 pauseImpression ( messageId: messageId)
3537 }
38+
3639 session. embeddedSessionEnd = Date ( )
3740 updateDisplayDurations ( )
3841
3942
40-
4143 if session. impressions. isEmpty {
42- ITBInfo ( " No impressions in the session. Skipping tracking. " )
43- return
44- }
44+ ITBInfo ( " No impressions in the session. Skipping tracking. " )
45+ session. isActive = false
46+ return
47+ }
4548
4649 for index in session. impressions. indices {
4750 let displayDuration = session. impressions [ index] . displayDuration
You can’t perform that action at this time.
0 commit comments