Skip to content
This repository has been archived by the owner on Jan 5, 2024. It is now read-only.

Commit

Permalink
Fixed unstored events
Browse files Browse the repository at this point in the history
  • Loading branch information
akuzminskyi committed Dec 30, 2021
1 parent 10af9c9 commit 88fe024
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions JustTrack/Classes/JustTrack/Operations/TrackOperation.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,15 @@ class TrackOperation: Operation {
self.tracker = tracker
self.eventKey = "\(event.name)_ON_\(tracker.name)_\(Date().timeIntervalSince1970)"
super.init()

// Persist the event.
saveEvent(event, key: eventKey)
}

// MARK: - Operation lifecycle

override func main() {
guard !isCancelled else { return }

// Persist the event.
// Delete it before posting if the operation was cancelled while persisting the event.
saveEvent(event, key: eventKey)
guard !isCancelled else {
deleteEvent(eventKey)
return
Expand Down

0 comments on commit 88fe024

Please sign in to comment.