Fix push issues

This commit is contained in:
Justin Mazzocchi 2020-11-21 15:21:04 -08:00
parent 2397758456
commit ad4e699ce1
No known key found for this signature in database
GPG Key ID: E223E6937AAFB01C
2 changed files with 10 additions and 1 deletions

View File

@ -19,7 +19,13 @@ extension LiveKeychain: Keychain {
query[kSecValueData as String] = data
let status = SecItemAdd(query as CFDictionary, nil)
var status = SecItemAdd(query as CFDictionary, nil)
if status == errSecDuplicateItem {
status = SecItemUpdate(
genericPasswordQueryDictionary(account: account, service: service) as CFDictionary,
[kSecValueData as String: data] as CFDictionary)
}
if status != errSecSuccess {
throw NSError(status: status)
@ -54,6 +60,8 @@ extension LiveKeychain: Keychain {
}
public static func generateKeyAndReturnPublicKey(applicationTag: String, attributes: [String: Any]) throws -> Data {
try? deleteKey(applicationTag: applicationTag)
var attributes = attributes
var error: Unmanaged<CFError>?

View File

@ -124,6 +124,7 @@ public extension AllIdentitiesService {
}
}
.map(Publishers.MergeMany.init)
.flatMap { $0 }
.ignoreOutput()
.eraseToAnyPublisher()
}