nav: only save columns once

Before we would save columns for each rendered nav. Now we only do it
once.
This commit is contained in:
William Casarin
2024-11-19 18:51:01 -08:00
parent 7f234935cc
commit 679a5afdeb
2 changed files with 14 additions and 8 deletions

View File

@@ -7,7 +7,6 @@ use crate::{
profile::Profile,
relay_pool_manager::RelayPoolManager,
route::Route,
storage::{self},
thread::Thread,
timeline::{
route::{render_timeline_route, TimelineRoute},
@@ -60,7 +59,8 @@ impl RenderNavResponse {
RenderNavResponse { column, response }
}
pub fn process_render_nav_response(&self, app: &mut Damus) {
#[must_use = "Make sure to save columns if result is true"]
pub fn process_render_nav_response(&self, app: &mut Damus) -> bool {
let mut col_changed: bool = false;
let col = self.column;
@@ -146,9 +146,7 @@ impl RenderNavResponse {
}
}
if col_changed {
storage::save_columns(&app.path, app.columns().as_serializable_columns());
}
col_changed
}
}