From 88fe02458a752aa9d49c73923f44a48b757e1e4c Mon Sep 17 00:00:00 2001 From: Andrii Kuzminskyi Date: Thu, 30 Dec 2021 14:29:29 +0100 Subject: [PATCH] Fixed unstored events --- .../Classes/JustTrack/Operations/TrackOperation.swift | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/JustTrack/Classes/JustTrack/Operations/TrackOperation.swift b/JustTrack/Classes/JustTrack/Operations/TrackOperation.swift index dd2513d..dedad6f 100644 --- a/JustTrack/Classes/JustTrack/Operations/TrackOperation.swift +++ b/JustTrack/Classes/JustTrack/Operations/TrackOperation.swift @@ -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