cleanups
This commit is contained in:
@@ -42,7 +42,7 @@ pub struct Damus {
|
|||||||
is_mobile: bool,
|
is_mobile: bool,
|
||||||
|
|
||||||
/// global navigation for account management popups, etc.
|
/// global navigation for account management popups, etc.
|
||||||
nav: Vec<Route>,
|
_nav: Vec<Route>,
|
||||||
pub textmode: bool,
|
pub textmode: bool,
|
||||||
|
|
||||||
pub timelines: Vec<Timeline>,
|
pub timelines: Vec<Timeline>,
|
||||||
@@ -651,7 +651,7 @@ impl Damus {
|
|||||||
img_cache: ImageCache::new(imgcache_dir),
|
img_cache: ImageCache::new(imgcache_dir),
|
||||||
note_cache: NoteCache::default(),
|
note_cache: NoteCache::default(),
|
||||||
selected_timeline: 0,
|
selected_timeline: 0,
|
||||||
nav: Vec::with_capacity(6),
|
_nav: Vec::with_capacity(6),
|
||||||
timelines,
|
timelines,
|
||||||
textmode: false,
|
textmode: false,
|
||||||
ndb: Ndb::new(data_path.as_ref().to_str().expect("db path ok"), &config).expect("ndb"),
|
ndb: Ndb::new(data_path.as_ref().to_str().expect("db path ok"), &config).expect("ndb"),
|
||||||
@@ -684,7 +684,7 @@ impl Damus {
|
|||||||
note_cache: NoteCache::default(),
|
note_cache: NoteCache::default(),
|
||||||
selected_timeline: 0,
|
selected_timeline: 0,
|
||||||
timelines,
|
timelines,
|
||||||
nav: vec![],
|
_nav: vec![],
|
||||||
textmode: false,
|
textmode: false,
|
||||||
ndb: Ndb::new(data_path.as_ref().to_str().expect("db path ok"), &config).expect("ndb"),
|
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),
|
account_manager: AccountManager::new(None, crate::key_storage::KeyStorage::None),
|
||||||
|
|||||||
@@ -19,7 +19,6 @@ pub mod login_manager;
|
|||||||
mod macos_key_storage;
|
mod macos_key_storage;
|
||||||
mod notecache;
|
mod notecache;
|
||||||
mod profile;
|
mod profile;
|
||||||
mod relay_generation;
|
|
||||||
pub mod relay_pool_manager;
|
pub mod relay_pool_manager;
|
||||||
mod result;
|
mod result;
|
||||||
mod route;
|
mod route;
|
||||||
|
|||||||
@@ -1,27 +0,0 @@
|
|||||||
use enostr::RelayPool;
|
|
||||||
use tracing::error;
|
|
||||||
|
|
||||||
fn test_relay_pool(wakeup: impl Fn() + Send + Sync + Clone + 'static) -> RelayPool {
|
|
||||||
let mut pool = RelayPool::new();
|
|
||||||
|
|
||||||
if let Err(e) = pool.add_url("ws://localhost:8080".to_string(), wakeup.clone()) {
|
|
||||||
error!("{:?}", e)
|
|
||||||
}
|
|
||||||
if let Err(e) = pool.add_url("wss://relay.damus.io".to_string(), wakeup.clone()) {
|
|
||||||
error!("{:?}", e)
|
|
||||||
}
|
|
||||||
if let Err(e) = pool.add_url("wss://pyramid.fiatjaf.com".to_string(), wakeup.clone()) {
|
|
||||||
error!("{:?}", e)
|
|
||||||
}
|
|
||||||
if let Err(e) = pool.add_url("wss://nos.lol".to_string(), wakeup.clone()) {
|
|
||||||
error!("{:?}", e)
|
|
||||||
}
|
|
||||||
if let Err(e) = pool.add_url("wss://nostr.wine".to_string(), wakeup.clone()) {
|
|
||||||
error!("{:?}", e)
|
|
||||||
}
|
|
||||||
if let Err(e) = pool.add_url("wss://purplepag.es".to_string(), wakeup) {
|
|
||||||
error!("{:?}", e)
|
|
||||||
}
|
|
||||||
|
|
||||||
pool
|
|
||||||
}
|
|
||||||
@@ -1,7 +1,9 @@
|
|||||||
use nostrdb::NoteKey;
|
//use nostrdb::NoteKey;
|
||||||
|
|
||||||
/// App routing. These describe different places you can go inside Notedeck.
|
/// App routing. These describe different places you can go inside Notedeck.
|
||||||
pub enum Route {
|
pub enum Route {
|
||||||
|
/*
|
||||||
ManageAccount,
|
ManageAccount,
|
||||||
Thread(NoteKey),
|
Thread(NoteKey),
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,8 +18,8 @@ pub struct AccountSelectionWidget<'a> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
enum AccountSelectAction {
|
enum AccountSelectAction {
|
||||||
RemoveAccount { index: usize },
|
RemoveAccount { _index: usize },
|
||||||
SelectAccount { index: usize },
|
SelectAccount { _index: usize },
|
||||||
OpenAccountManagement,
|
OpenAccountManagement,
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -57,19 +57,19 @@ impl<'a> AccountSelectionWidget<'a> {
|
|||||||
res = top_section_widget(ui);
|
res = top_section_widget(ui);
|
||||||
|
|
||||||
scroll_area().show(ui, |ui| {
|
scroll_area().show(ui, |ui| {
|
||||||
if let Some(index) = self.show_accounts(ui) {
|
if let Some(_index) = self.show_accounts(ui) {
|
||||||
selected_index = Some(index);
|
selected_index = Some(_index);
|
||||||
res.action = Some(AccountSelectAction::SelectAccount { index });
|
res.action = Some(AccountSelectAction::SelectAccount { _index });
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
ui.add_space(8.0);
|
ui.add_space(8.0);
|
||||||
ui.add(add_account_button());
|
ui.add(add_account_button());
|
||||||
|
|
||||||
if let Some(index) = selected_index {
|
if let Some(_index) = selected_index {
|
||||||
if let Some(account) = self.account_manager.get_account(index) {
|
if let Some(account) = self.account_manager.get_account(_index) {
|
||||||
ui.add_space(8.0);
|
ui.add_space(8.0);
|
||||||
if self.handle_sign_out(ui, account) {
|
if self.handle_sign_out(ui, account) {
|
||||||
res.action = Some(AccountSelectAction::RemoveAccount { index })
|
res.action = Some(AccountSelectAction::RemoveAccount { _index })
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user