change update password related functions

This commit is contained in:
Bob Sun 2017-02-15 20:01:17 +08:00
parent 8d474677da
commit 869f06e00f
No known key found for this signature in database
GPG key ID: 1F86BA2052FED3B4
4 changed files with 40 additions and 23 deletions

View file

@ -331,11 +331,18 @@ class PasswordStore {
let encryptedData = try passwordEntity.encrypt(password: password)
let saveURL = storeURL.appendingPathComponent(passwordEntity.rawPath!)
try encryptedData.write(to: saveURL)
passwordEntity.synced = false
progressBlock(0.3)
let _ = createAddCommitInRepository(message: "Update password by pass for iOS", fileData: encryptedData, filename: saveURL.lastPathComponent, progressBlock: progressBlock)
} catch {
print(error)
}
}
func saveUpdated(passwordEntity: PasswordEntity) {
do {
try context.save()
} catch {
fatalError("Failed to fetch employees: \(error)")
fatalError("Failed to save a PasswordEntity: \(error)")
}
}