forked from shadowfacts/Tusker
Maybe fix crash in sceneDidEnterBackground
This commit is contained in:
parent
b4675a97c7
commit
6d6fd3d49d
|
@ -123,7 +123,10 @@ class MainSceneDelegate: UIResponder, UIWindowSceneDelegate {
|
|||
rootVC.sceneDidEnterBackground()
|
||||
}
|
||||
|
||||
if let context = scene.session.mastodonController?.persistentContainer.viewContext {
|
||||
if let context = scene.session.mastodonController?.persistentContainer.viewContext,
|
||||
// if the user quickly opens and then closes the app, this may race with loading the persistent store, so in that event we skip cleanup/save
|
||||
let psc = context.persistentStoreCoordinator,
|
||||
!psc.persistentStores.isEmpty {
|
||||
var minDate = Date()
|
||||
minDate.addTimeInterval(-7 * 24 * 60 * 60)
|
||||
|
||||
|
|
Loading…
Reference in New Issue