push column picker immediately to new column

instead of pushing to temporary column first

Signed-off-by: kernelkind <kernelkind@gmail.com>
This commit is contained in:
kernelkind
2024-10-01 12:51:14 -04:00
parent ebe4bf3046
commit 57069ff7c0
6 changed files with 80 additions and 46 deletions

View File

@@ -47,6 +47,22 @@ impl Columns {
self.columns.push(Column::new(routes))
}
pub fn add_timeline_to_column(&mut self, col: usize, timeline: Timeline) -> bool {
if let Some(column) = self.columns.get_mut(col) {
column
.router_mut()
.route_to_replaced(Route::timeline(timeline.id));
self.timelines.push(timeline);
true
} else {
false
}
}
pub fn new_column_picker(&mut self) {
self.columns.push(Column::new(vec![Route::AddColumn]));
}
pub fn columns_mut(&mut self) -> &mut Vec<Column> {
&mut self.columns
}