mirror of
https://github.com/aljazceru/notedeck.git
synced 2026-01-18 15:54:20 +01:00
ui: hook up relay management view
Signed-off-by: William Casarin <jb55@jb55.com>
This commit is contained in:
@@ -973,7 +973,9 @@ fn timelines_view(ui: &mut egui::Ui, sizes: Size, app: &mut Damus, columns: usiz
|
||||
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
|
||||
ui.painter().vline(
|
||||
|
||||
@@ -27,6 +27,10 @@ impl Route {
|
||||
}
|
||||
}
|
||||
|
||||
pub fn relays() -> Self {
|
||||
Route::Relays
|
||||
}
|
||||
|
||||
pub fn thread(thread_root: NoteId) -> Self {
|
||||
Route::Timeline(TimelineRoute::Thread(thread_root))
|
||||
}
|
||||
|
||||
@@ -101,7 +101,14 @@ impl<'a> DesktopSidePanel<'a> {
|
||||
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
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user