|
1 | | -use nostr_sdk::Keys; |
| 1 | +use enostr::FullKeypair; |
2 | 2 | use nostrdb::{Ndb, Transaction}; |
3 | 3 |
|
4 | 4 | pub use crate::user_account::UserAccount; |
@@ -35,7 +35,7 @@ impl<'a> SimpleProfilePreviewController<'a> { |
35 | 35 | if let Ok(txn) = Transaction::new(self.ndb) { |
36 | 36 | let profile = self |
37 | 37 | .ndb |
38 | | - .get_profile_by_pubkey(&txn, &account.key.public_key().to_bytes()); |
| 38 | + .get_profile_by_pubkey(&txn, account.key.pubkey.bytes()); |
39 | 39 |
|
40 | 40 | if let Ok(profile) = profile { |
41 | 41 | let preview = SimpleProfilePreview::new(&profile, self.img_cache); |
@@ -67,7 +67,7 @@ impl<'a> SimpleProfilePreviewController<'a> { |
67 | 67 | if let Ok(txn) = Transaction::new(self.ndb) { |
68 | 68 | let profile = self |
69 | 69 | .ndb |
70 | | - .get_profile_by_pubkey(&txn, &account.key.public_key().to_bytes()); |
| 70 | + .get_profile_by_pubkey(&txn, account.key.pubkey.bytes()); |
71 | 71 |
|
72 | 72 | if let Ok(profile) = profile { |
73 | 73 | let preview = SimpleProfilePreview::new(&profile, self.img_cache); |
@@ -115,16 +115,16 @@ impl<'a> AccountManager<'a> { |
115 | 115 |
|
116 | 116 | pub fn remove_account(&mut self, index: usize) { |
117 | 117 | if let Some(account) = self.accounts.get(index) { |
118 | | - self.key_store.remove_key(&account.key); |
| 118 | + let _ = self.key_store.remove_key(&account.key); |
119 | 119 | } |
120 | 120 | if index < self.accounts.len() { |
121 | 121 | self.accounts.remove(index); |
122 | 122 | } |
123 | 123 | } |
124 | 124 |
|
125 | | - pub fn add_account(&'a mut self, key: Keys, ctx: &egui::Context) { |
126 | | - self.key_store.add_key(&key); |
127 | | - let relays = self.relay_generator.generate_relays_for(&key, ctx); |
| 125 | + pub fn add_account(&'a mut self, key: FullKeypair, ctx: &egui::Context) { |
| 126 | + let _ = self.key_store.add_key(&key); |
| 127 | + let relays = self.relay_generator.generate_relays_for(&key.pubkey, ctx); |
128 | 128 | let account = UserAccount { key, relays }; |
129 | 129 |
|
130 | 130 | self.accounts.push(account) |
|
0 commit comments