columns/nav: ocd nevernest

no behavior changed

Signed-off-by: William Casarin <jb55@jb55.com>
This commit is contained in:
William Casarin
2025-07-15 09:29:21 -07:00
parent 6f266fc91d
commit f2adb949f6

View File

@@ -668,7 +668,11 @@ fn render_nav_body(
}
Route::EditProfile(pubkey) => {
let mut action = None;
if let Some(kp) = ctx.accounts.get_full(pubkey) {
let Some(kp) = ctx.accounts.get_full(pubkey) else {
error!("Pubkey in EditProfile route did not have an nsec attached in Accounts");
return None;
};
let state = app
.view_state
.pubkey_to_profile_state
@@ -690,18 +694,16 @@ fn render_nav_body(
ProfileState::default()
}
});
if EditProfileView::new(state, ctx.img_cache).ui(ui) {
if let Some(taken_state) =
app.view_state.pubkey_to_profile_state.remove(kp.pubkey)
if let Some(taken_state) = app.view_state.pubkey_to_profile_state.remove(kp.pubkey)
{
action = Some(RenderNavAction::ProfileAction(ProfileAction::SaveChanges(
SaveProfileChanges::new(kp.to_full(), taken_state),
)))
}
}
} else {
error!("Pubkey in EditProfile route did not have an nsec attached in Accounts");
}
action
}
Route::Wallet(wallet_type) => {