ui: update account management to design
Closes: https://github.com/damus-io/notedeck/issues/486 Fixes: https://github.com/damus-io/notedeck/issues/444 Signed-off-by: kernelkind <kernelkind@gmail.com> Signed-off-by: William Casarin <jb55@jb55.com>
This commit is contained in:
committed by
William Casarin
parent
409e8c2e3a
commit
0ac131ef06
@@ -131,7 +131,16 @@ impl Accounts {
|
||||
self.select_account(selected_index - 1);
|
||||
}
|
||||
Ordering::Equal => {
|
||||
self.clear_selected_account();
|
||||
if self.accounts.is_empty() {
|
||||
// If no accounts remain, clear the selection
|
||||
self.clear_selected_account();
|
||||
} else if index >= self.accounts.len() {
|
||||
// If the removed account was the last one, select the new last account
|
||||
self.select_account(self.accounts.len() - 1);
|
||||
} else {
|
||||
// Otherwise, select the account at the same position
|
||||
self.select_account(index);
|
||||
}
|
||||
}
|
||||
Ordering::Less => {}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user