make AccountManagementView stateless
Signed-off-by: kernelkind <kernelkind@gmail.com>
This commit is contained in:
committed by
William Casarin
parent
dda7256f51
commit
3a9c7607f3
@@ -2,8 +2,11 @@ use std::cmp::Ordering;
|
||||
|
||||
use enostr::{FilledKeypair, Keypair};
|
||||
|
||||
use crate::key_storage::{KeyStorage, KeyStorageResponse, KeyStorageType};
|
||||
pub use crate::user_account::UserAccount;
|
||||
use crate::{
|
||||
key_storage::{KeyStorage, KeyStorageResponse, KeyStorageType},
|
||||
ui::account_management::AccountManagementViewResponse,
|
||||
};
|
||||
use tracing::info;
|
||||
|
||||
/// The interface for managing the user's accounts.
|
||||
@@ -116,3 +119,17 @@ impl AccountManager {
|
||||
self.currently_selected_account = None
|
||||
}
|
||||
}
|
||||
|
||||
pub fn process_view_response(
|
||||
manager: &mut AccountManager,
|
||||
response: AccountManagementViewResponse,
|
||||
) {
|
||||
match response {
|
||||
AccountManagementViewResponse::RemoveAccount(index) => {
|
||||
manager.remove_account(index);
|
||||
}
|
||||
AccountManagementViewResponse::SelectAccount(index) => {
|
||||
manager.select_account(index);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user