Skip to content

Commit

Permalink
Use Blog instance's context to access its properties
Browse files Browse the repository at this point in the history
  • Loading branch information
crazytonyli committed Oct 10, 2022
1 parent 6f106f6 commit bd2f325
Showing 1 changed file with 9 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -537,10 +537,15 @@ class WeeklyRoundupNotificationScheduler {
comments: Int,
likes: Int,
periodEndDate: Date,
completion: @escaping (Result<Void, Error>) -> Void) {

let siteTitle = site.title
let dotComID = site.dotComID?.intValue
completion: @escaping (Result<Void, Error>) -> Void
) {
var siteTitle: String?
var dotComID: Int?

site.managedObjectContext?.performAndWait {
siteTitle = site.title
dotComID = site.dotComID?.intValue
}

guard let dotComID = dotComID else {
// Error
Expand Down

0 comments on commit bd2f325

Please sign in to comment.