ui: hook up relay management view

Signed-off-by: William Casarin <jb55@jb55.com>
This commit is contained in:
William Casarin
2024-09-16 17:09:32 -07:00
parent fce82b2b6d
commit 945ccde818
3 changed files with 15 additions and 2 deletions

View File

@@ -973,7 +973,9 @@ fn timelines_view(ui: &mut egui::Ui, sizes: Size, app: &mut Damus, columns: usiz
columns[0].router_mut() columns[0].router_mut()
}; };
DesktopSidePanel::perform_action(router, side_panel.action); if side_panel.response.clicked() {
DesktopSidePanel::perform_action(router, side_panel.action);
}
// vertical sidebar line // vertical sidebar line
ui.painter().vline( ui.painter().vline(

View File

@@ -27,6 +27,10 @@ impl Route {
} }
} }
pub fn relays() -> Self {
Route::Relays
}
pub fn thread(thread_root: NoteId) -> Self { pub fn thread(thread_root: NoteId) -> Self {
Route::Timeline(TimelineRoute::Thread(thread_root)) Route::Timeline(TimelineRoute::Thread(thread_root))
} }

View File

@@ -101,7 +101,14 @@ impl<'a> DesktopSidePanel<'a> {
router.route_to(Route::accounts()); router.route_to(Route::accounts());
} }
} }
SidePanelAction::Settings => {} // TODO SidePanelAction::Settings => {
if router.routes().iter().any(|&r| r == Route::Relays) {
// return if we are already routing to accounts
router.go_back();
} else {
router.route_to(Route::relays());
}
}
SidePanelAction::Columns => (), // TODO SidePanelAction::Columns => (), // TODO
} }
} }