diff --git a/OpenSesame.xcodeproj/project.xcworkspace/xcuserdata/ethan.xcuserdatad/UserInterfaceState.xcuserstate b/OpenSesame.xcodeproj/project.xcworkspace/xcuserdata/ethan.xcuserdatad/UserInterfaceState.xcuserstate
index 956c314..bcbbd71 100644
Binary files a/OpenSesame.xcodeproj/project.xcworkspace/xcuserdata/ethan.xcuserdatad/UserInterfaceState.xcuserstate and b/OpenSesame.xcodeproj/project.xcworkspace/xcuserdata/ethan.xcuserdatad/UserInterfaceState.xcuserstate differ
diff --git a/Shared/OpenSesame.xcdatamodeld/Shared 1.1.xcdatamodel/contents b/Shared/OpenSesame.xcdatamodeld/Shared 1.1.xcdatamodel/contents
new file mode 100644
index 0000000..9dca5f9
--- /dev/null
+++ b/Shared/OpenSesame.xcdatamodeld/Shared 1.1.xcdatamodel/contents
@@ -0,0 +1,24 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Shared/OpenSesame.xcdatamodeld/Shared.xcdatamodel/contents b/Shared/OpenSesame.xcdatamodeld/Shared.xcdatamodel/contents
index b7c65ed..9dca5f9 100644
--- a/Shared/OpenSesame.xcdatamodeld/Shared.xcdatamodel/contents
+++ b/Shared/OpenSesame.xcdatamodeld/Shared.xcdatamodel/contents
@@ -3,10 +3,8 @@
-
-
@@ -20,7 +18,7 @@
-
+
\ No newline at end of file
diff --git a/Shared/OpenSesameMapping.xcmappingmodel/xcmapping.xml b/Shared/OpenSesameMapping.xcmappingmodel/xcmapping.xml
new file mode 100644
index 0000000..b311411
--- /dev/null
+++ b/Shared/OpenSesameMapping.xcmappingmodel/xcmapping.xml
@@ -0,0 +1,138 @@
+
+
+
+
+
+ 134481920
+ 21A5255D-36C9-41BC-B2A9-5F68BE15D7E2
+ 118
+
+
+
+ NSPersistenceFrameworkVersion
+ 1132
+ NSStoreModelVersionHashes
+
+ XDDevAttributeMapping
+
+ 0plcXXRN7XHKl5CcF+fwriFmUpON3ZtcI/AfK748aWc=
+
+ XDDevEntityMapping
+
+ qeN1Ym3TkWN1G6dU9RfX6Kd2ccEvcDVWHpd3LpLgboI=
+
+ XDDevMappingModel
+
+ EqtMzvRnVZWkXwBHu4VeVGy8UyoOe+bi67KC79kphlQ=
+
+ XDDevPropertyMapping
+
+ XN33V44TTGY4JETlMoOB5yyTKxB+u4slvDIinv0rtGA=
+
+ XDDevRelationshipMapping
+
+ akYY9LhehVA/mCb4ATLWuI9XGLcjpm14wWL1oEBtIcs=
+
+
+ NSStoreModelVersionHashesDigest
+ +Hmc2uYZK6og+Pvx5GUJ7oW75UG4V/ksQanTjfTKUnxyGWJRMtB5tIRgVwGsrd7lz/QR57++wbvWsr6nxwyS0A==
+ NSStoreModelVersionHashesVersion
+ 3
+ NSStoreModelVersionIdentifiers
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Shared/Persistence.swift b/Shared/Persistence.swift
index ba00292..353fd3f 100644
--- a/Shared/Persistence.swift
+++ b/Shared/Persistence.swift
@@ -7,6 +7,7 @@
import Foundation
import CoreData
+import KeychainAccess
struct PersistenceController {
static let shared = PersistenceController()
@@ -52,6 +53,16 @@ struct PersistenceController {
print("CoreData location", PersistenceController.storeURL.path)
}
+
+ if let coreDataVersion = UserDefaults(suiteName: "group.OpenSesame.ethanlipnik")?.float(forKey: "coreDataVersion"), coreDataVersion < 1.1 {
+ try? FileManager.default.removeItem(at: PersistenceController.storeURL)
+ try? Keychain(service: "com.ethanlipnik.OpenSesame", accessGroup: "B6QG723P8Z.OpenSesame")
+ .synchronizable(true)
+ .remove("encryptionTest")
+
+ UserDefaults(suiteName: "group.OpenSesame.ethanlipnik")?.set(1.1, forKey: "coreDataVersion")
+ }
+
let viewContext = container.viewContext
container.loadPersistentStores(completionHandler: { (storeDescription, error) in
if let error = error as NSError? {
diff --git a/Shared/Views/ContentView/ContentView+List.swift b/Shared/Views/ContentView/ContentView+List.swift
index fa45579..449d5d2 100644
--- a/Shared/Views/ContentView/ContentView+List.swift
+++ b/Shared/Views/ContentView/ContentView+List.swift
@@ -58,7 +58,11 @@ extension ContentView {
Section("Pinned") {
ForEach(pinnedAccounts) { account in
NavigationLink {
- VaultView(vault: account.vault!, selectedAccount: account)
+ if let vault = account.vault {
+ VaultView(vault: vault, selectedAccount: account)
+ } else {
+ Text("Failed to get vault for pinned account")
+ }
} label: {
VStack(alignment: .leading) {
Text(account.domain!.capitalizingFirstLetter())
diff --git a/Shared/Views/LockView/LockView+CreatePassword.swift b/Shared/Views/LockView/LockView+CreatePassword.swift
index 56308f9..f69bcc9 100644
--- a/Shared/Views/LockView/LockView+CreatePassword.swift
+++ b/Shared/Views/LockView/LockView+CreatePassword.swift
@@ -18,6 +18,7 @@ extension LockView {
.font(.title.bold())
GroupBox {
TextField("Enter a new master password", text: $password, onCommit: {
+ guard !password.isEmpty else { return }
completionAction(password)
})
.font(.system(.body, design: .monospaced))
@@ -28,6 +29,7 @@ extension LockView {
#endif
}
Button("Continue") {
+ guard !password.isEmpty else { return }
completionAction(password)
}
}