Skip to content

Commit

Permalink
timeline segments shouldn't process items if they overlap with the re…
Browse files Browse the repository at this point in the history
…corder's zone of responsibility #11
  • Loading branch information
sobri909 committed May 29, 2018
1 parent 82a2a8e commit 2d65a0b
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions LocoKit/LocalStore/TimelineSegment.swift
Original file line number Diff line number Diff line change
Expand Up @@ -132,9 +132,13 @@ public class TimelineSegment: TransactionObserver {
}

private func process() {
if let items = timelineItems {
TimelineProcessor.process(items)
}
guard let items = timelineItems else { return }

// shouldn't do processing if currentItem is in the segment and isn't a keeper
// (the TimelineRecorder should be the sole authority on processing those cases)
for item in items { if item.isCurrentItem && !item.isWorthKeeping { return } }

TimelineProcessor.process(items)
}

// MARK: - TransactionObserver
Expand Down

0 comments on commit 2d65a0b

Please sign in to comment.