Fix erase and removePGPKeys

- Remove SharedDefaults instead of Defaults
This commit is contained in:
Yishi Lin 2017-06-13 13:04:39 +08:00
parent d2ba620ae4
commit 86a6fb6395

View file

@ -726,7 +726,7 @@ public class PasswordStore {
deleteCoreData(entityName: "PasswordEntity")
Defaults.removeAll()
SharedDefaults.removeAll()
storeRepository = nil
NotificationCenter.default.post(name: .passwordStoreUpdated, object: nil)
@ -818,11 +818,11 @@ public class PasswordStore {
public func removePGPKeys() {
Utils.removeFileIfExists(atPath: Globals.pgpPublicKeyPath)
Utils.removeFileIfExists(atPath: Globals.pgpPrivateKeyPath)
Defaults.remove(.pgpKeySource)
Defaults.remove(.pgpPublicKeyArmor)
Defaults.remove(.pgpPrivateKeyArmor)
Defaults.remove(.pgpPrivateKeyURL)
Defaults.remove(.pgpPublicKeyURL)
SharedDefaults.remove(.pgpKeySource)
SharedDefaults.remove(.pgpPublicKeyArmor)
SharedDefaults.remove(.pgpPrivateKeyArmor)
SharedDefaults.remove(.pgpPrivateKeyURL)
SharedDefaults.remove(.pgpPublicKeyURL)
Utils.removeKeychain(name: ".pgpKeyPassphrase")
pgp = ObjectivePGP()
publicKey = nil