(Fix) autofill / extensions and restore persistent storage location (#686)
This commit is contained in:
parent
4ceed65182
commit
cb8305f014
3 changed files with 4 additions and 3 deletions
|
|
@ -23,7 +23,6 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
|
||||||
lazy var passcodeLockPresenter = PasscodeLockPresenter(mainWindow: self.window)
|
lazy var passcodeLockPresenter = PasscodeLockPresenter(mainWindow: self.window)
|
||||||
|
|
||||||
func application(_: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
|
func application(_: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
|
||||||
PersistenceController.shared.setup()
|
|
||||||
// Override point for customization after application launch.
|
// Override point for customization after application launch.
|
||||||
SVProgressHUD.setMinimumSize(CGSize(width: 150, height: 100))
|
SVProgressHUD.setMinimumSize(CGSize(width: 150, height: 100))
|
||||||
passcodeLockPresenter.present(windowLevel: UIApplication.shared.windows.last?.windowLevel.rawValue)
|
passcodeLockPresenter.present(windowLevel: UIApplication.shared.windows.last?.windowLevel.rawValue)
|
||||||
|
|
|
||||||
|
|
@ -25,10 +25,13 @@ public class PersistenceController {
|
||||||
description?.shouldInferMappingModelAutomatically = false
|
description?.shouldInferMappingModelAutomatically = false
|
||||||
if isUnitTest {
|
if isUnitTest {
|
||||||
description?.url = URL(fileURLWithPath: "/dev/null")
|
description?.url = URL(fileURLWithPath: "/dev/null")
|
||||||
|
} else {
|
||||||
|
description?.url = URL(fileURLWithPath: Globals.dbPath)
|
||||||
}
|
}
|
||||||
|
setup()
|
||||||
}
|
}
|
||||||
|
|
||||||
public func setup() {
|
func setup() {
|
||||||
container.loadPersistentStores { _, error in
|
container.loadPersistentStores { _, error in
|
||||||
if error != nil {
|
if error != nil {
|
||||||
self.reinitializePersistentStore()
|
self.reinitializePersistentStore()
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,6 @@ class CoreDataTestCase: XCTestCase {
|
||||||
try super.setUpWithError()
|
try super.setUpWithError()
|
||||||
|
|
||||||
controller = PersistenceController(isUnitTest: true)
|
controller = PersistenceController(isUnitTest: true)
|
||||||
controller.setup()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
override func tearDown() {
|
override func tearDown() {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue