columns: navigate back when switching account

Fixes: https://github.com/damus-io/notedeck/issues/600
Signed-off-by: William Casarin <jb55@jb55.com>
This commit is contained in:
William Casarin
2024-12-20 13:54:20 -08:00
parent 40c5dbf418
commit 475314da75
5 changed files with 45 additions and 15 deletions

View File

@@ -1,7 +1,9 @@
use enostr::FullKeypair;
use nostrdb::Ndb;
use notedeck::{Accounts, AccountsAction, AddAccountAction, ImageCache, SingleUnkIdAction};
use notedeck::{
Accounts, AccountsAction, AddAccountAction, ImageCache, SingleUnkIdAction, SwitchAccountAction,
};
use crate::app::get_active_columns_mut;
use crate::decks::DecksCache;
@@ -87,7 +89,7 @@ pub fn process_accounts_view_response(
selection = Some(acc_sel);
}
AccountsViewResponse::SelectAccount(index) => {
let acc_sel = AccountsAction::Switch(index);
let acc_sel = AccountsAction::Switch(SwitchAccountAction::new(Some(col), index));
info!("account selection: {:?}", acc_sel);
selection = Some(acc_sel);
}