committed by
William Casarin
parent
f489ed3b9e
commit
c0b1a01b5d
@@ -87,10 +87,22 @@ impl AccountManager {
|
||||
self.accounts.len()
|
||||
}
|
||||
|
||||
pub fn get_currently_selected_account(&self) -> Option<usize> {
|
||||
pub fn get_selected_account_index(&self) -> Option<usize> {
|
||||
self.currently_selected_account
|
||||
}
|
||||
|
||||
pub fn get_selected_account(&self) -> Option<&UserAccount> {
|
||||
if let Some(account_index) = self.currently_selected_account {
|
||||
if let Some(account) = self.get_account(account_index) {
|
||||
Some(account)
|
||||
} else {
|
||||
None
|
||||
}
|
||||
} else {
|
||||
None
|
||||
}
|
||||
}
|
||||
|
||||
pub fn select_account(&mut self, index: usize) {
|
||||
if self.accounts.get(index).is_some() {
|
||||
self.currently_selected_account = Some(index)
|
||||
|
||||
Reference in New Issue
Block a user