make selected accounts non optional
Signed-off-by: kernelkind <kernelkind@gmail.com>
This commit is contained in:
@@ -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();
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user