Skip to content

Commit

Permalink
Make coreDataStack private
Browse files Browse the repository at this point in the history
  • Loading branch information
whattherestimefor committed Nov 15, 2024
1 parent d7f473c commit 08b47dd
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion MastodonSDK/Sources/MastodonCore/AppContext.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import AlamofireImage
@MainActor
public class PersistenceManager {
public static let shared = { PersistenceManager() }()
public let coreDataStack: CoreDataStack
private let coreDataStack: CoreDataStack
public let mainActorManagedObjectContext: NSManagedObjectContext
public let backgroundManagedObjectContext: NSManagedObjectContext

Expand All @@ -40,6 +40,10 @@ public class PersistenceManager {
}
.store(in: &disposeBag)
}

func newTaskContext() -> NSManagedObjectContext {
return coreDataStack.newTaskContext()
}
}

@MainActor
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public final class APIService {
}

public static func isolatedService() -> APIService {
let taskContext = PersistenceManager.shared.coreDataStack.newTaskContext()
let taskContext = PersistenceManager.shared.newTaskContext()
return APIService(backgroundContext: taskContext)
}
}
Expand Down

0 comments on commit 08b47dd

Please sign in to comment.