save the private key to the keychain and not user defaults

This commit is contained in:
Thomas Rademaker
2022-12-22 18:13:33 -05:00
parent 68e9c127f9
commit 6a8100152f
6 changed files with 89 additions and 19 deletions

View File

@@ -107,8 +107,13 @@ struct SaveKeysView: View {
self.pool.send(.event(contacts_ev))
}
save_keypair(pubkey: account.pubkey, privkey: account.privkey)
notify(.login, account.keypair)
do {
try save_keypair(pubkey: account.pubkey, privkey: account.privkey)
notify(.login, account.keypair)
} catch {
self.error = "Failed to save keys"
}
case .error(let err):
self.loading = false
self.error = "\(err.debugDescription)"