make selected accounts non optional

Signed-off-by: kernelkind <kernelkind@gmail.com>
This commit is contained in:
kernelkind
2025-06-25 22:09:55 -04:00
parent 9cacb6bb69
commit 8e92a97a57
16 changed files with 136 additions and 196 deletions

View File

@@ -209,11 +209,7 @@ You are an AI agent for the nostr protocol called Dave, created by Damus. nostr
};
tracing::debug!("sending messages, latest: {:?}", messages.last().unwrap());
let user_id = app_ctx
.accounts
.get_selected_account()
.map(|sa| calculate_user_id(sa.keypair()))
.unwrap_or_else(|| "unknown_user".to_string());
let user_id = calculate_user_id(app_ctx.accounts.get_selected_account().keypair());
let ctx = ctx.clone();
let client = self.client.clone();

View File

@@ -497,7 +497,9 @@ fn pfp_button<'me, 'a>(
ndb: &Ndb,
) -> ProfilePic<'me, 'a> {
let account = accounts.get_selected_account();
let profile = account.and_then(|a| ndb.get_profile_by_pubkey(txn, a.key.pubkey.bytes()).ok());
let profile = ndb
.get_profile_by_pubkey(txn, account.key.pubkey.bytes())
.ok();
ProfilePic::from_profile_or_default(img_cache, profile.as_ref())
.size(24.0)