Skip to content

Commit

Permalink
Merge pull request #261 from goranbrl/fix/log_order_during_export
Browse files Browse the repository at this point in the history
Order exported items by creation date
  • Loading branch information
kean committed Jun 6, 2024
2 parents 2d37916 + a7a45ef commit 578df05
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Sources/PulseUI/Views/ShareStoreViewModel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,10 @@ import Combine
store.backgroundContext.perform {
let request = NSFetchRequest<LoggerMessageEntity>(entityName: "\(LoggerMessageEntity.self)")
request.predicate = options.predicate // important: contains sessions

let sortDescriptor = NSSortDescriptor(key: "createdAt", ascending: true)
request.sortDescriptors = [sortDescriptor]

let result = Result(catching: { try store.backgroundContext.fetch(request) })
continuation.resume(with: result)
}
Expand Down

0 comments on commit 578df05

Please sign in to comment.