diff --git a/crates/notedeck_columns/src/nav.rs b/crates/notedeck_columns/src/nav.rs index d96702ef..4d76f22c 100644 --- a/crates/notedeck_columns/src/nav.rs +++ b/crates/notedeck_columns/src/nav.rs @@ -173,6 +173,7 @@ impl RenderNavResponse { } RenderNavAction::ProfileAction(profile_action) => { profile_action.process( + &mut app.view_state.pubkey_to_profile_state, ctx.ndb, ctx.pool, get_active_columns_mut(ctx.accounts, &mut app.decks_cache) diff --git a/crates/notedeck_columns/src/profile.rs b/crates/notedeck_columns/src/profile.rs index 03fbc0be..436cfc20 100644 --- a/crates/notedeck_columns/src/profile.rs +++ b/crates/notedeck_columns/src/profile.rs @@ -1,3 +1,5 @@ +use std::collections::HashMap; + use enostr::{Filter, FullKeypair, Pubkey, RelayPool}; use nostrdb::{ FilterBuilder, Ndb, Note, NoteBuildOptions, NoteBuilder, ProfileRecord, Transaction, @@ -194,7 +196,13 @@ pub enum ProfileAction { } impl ProfileAction { - pub fn process(&self, ndb: &Ndb, pool: &mut RelayPool, router: &mut Router) { + pub fn process( + &self, + state_map: &mut HashMap, + ndb: &Ndb, + pool: &mut RelayPool, + router: &mut Router, + ) { match self { ProfileAction::Edit(kp) => { router.route_to(Route::EditProfile(kp.pubkey)); @@ -203,6 +211,7 @@ impl ProfileAction { let raw_msg = format!("[\"EVENT\",{}]", changes.to_note().json().unwrap()); let _ = ndb.process_client_event(raw_msg.as_str()); + let _ = state_map.remove_entry(&changes.kp.pubkey); info!("sending {}", raw_msg); pool.send(&enostr::ClientMessage::raw(raw_msg));