Skip to content

Commit

Permalink
cleanups
Browse files Browse the repository at this point in the history
  • Loading branch information
jb55 committed May 31, 2024
1 parent 2305f1e commit 6e69407
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 40 deletions.
6 changes: 3 additions & 3 deletions src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ pub struct Damus {
is_mobile: bool,

/// global navigation for account management popups, etc.
nav: Vec<Route>,
_nav: Vec<Route>,
pub textmode: bool,

pub timelines: Vec<Timeline>,
Expand Down Expand Up @@ -651,7 +651,7 @@ impl Damus {
img_cache: ImageCache::new(imgcache_dir),
note_cache: NoteCache::default(),
selected_timeline: 0,
nav: Vec::with_capacity(6),
_nav: Vec::with_capacity(6),
timelines,
textmode: false,
ndb: Ndb::new(data_path.as_ref().to_str().expect("db path ok"), &config).expect("ndb"),
Expand Down Expand Up @@ -684,7 +684,7 @@ impl Damus {
note_cache: NoteCache::default(),
selected_timeline: 0,
timelines,
nav: vec![],
_nav: vec![],
textmode: false,
ndb: Ndb::new(data_path.as_ref().to_str().expect("db path ok"), &config).expect("ndb"),
account_manager: AccountManager::new(None, crate::key_storage::KeyStorage::None),
Expand Down
1 change: 0 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ pub mod login_manager;
mod macos_key_storage;
mod notecache;
mod profile;
mod relay_generation;
pub mod relay_pool_manager;
mod result;
mod route;
Expand Down
27 changes: 0 additions & 27 deletions src/relay_generation.rs

This file was deleted.

4 changes: 3 additions & 1 deletion src/route.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
use nostrdb::NoteKey;
//use nostrdb::NoteKey;

/// App routing. These describe different places you can go inside Notedeck.
pub enum Route {
/*
ManageAccount,
Thread(NoteKey),
*/
}
16 changes: 8 additions & 8 deletions src/ui/account_switcher.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ pub struct AccountSelectionWidget<'a> {
}

enum AccountSelectAction {
RemoveAccount { index: usize },
SelectAccount { index: usize },
RemoveAccount { _index: usize },
SelectAccount { _index: usize },
OpenAccountManagement,
}

Expand Down Expand Up @@ -57,19 +57,19 @@ impl<'a> AccountSelectionWidget<'a> {
res = top_section_widget(ui);

scroll_area().show(ui, |ui| {
if let Some(index) = self.show_accounts(ui) {
selected_index = Some(index);
res.action = Some(AccountSelectAction::SelectAccount { index });
if let Some(_index) = self.show_accounts(ui) {
selected_index = Some(_index);
res.action = Some(AccountSelectAction::SelectAccount { _index });
}
});
ui.add_space(8.0);
ui.add(add_account_button());

if let Some(index) = selected_index {
if let Some(account) = self.account_manager.get_account(index) {
if let Some(_index) = selected_index {
if let Some(account) = self.account_manager.get_account(_index) {
ui.add_space(8.0);
if self.handle_sign_out(ui, account) {
res.action = Some(AccountSelectAction::RemoveAccount { index })
res.action = Some(AccountSelectAction::RemoveAccount { _index })
}
}
}
Expand Down

0 comments on commit 6e69407

Please sign in to comment.