Skip to content

Commit 871a1e9

Browse files
committed
fix: avoid changing terminal modes on drop
1 parent 31025bb commit 871a1e9

File tree

3 files changed

+268
-78
lines changed

3 files changed

+268
-78
lines changed

src/tui/app.rs

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -288,4 +288,25 @@ impl App {
288288
}
289289
}
290290

291+
pub fn update_repo_status(&mut self, display_name: &str, status: super::tree::RepoOperationStatus) {
292+
// Update in workspace tree
293+
update_repo_status_in_tree(&mut self.workspace_tree, display_name, status.clone());
294+
update_repo_status_in_tree(&mut self.filtered_workspace, display_name, status.clone());
295+
296+
// Update in library tree
297+
update_repo_status_in_tree(&mut self.library_tree, display_name, status.clone());
298+
update_repo_status_in_tree(&mut self.filtered_library, display_name, status);
299+
}
300+
301+
}
302+
303+
fn update_repo_status_in_tree(nodes: &mut [TreeNode], display_name: &str, status: super::tree::RepoOperationStatus) {
304+
for node in nodes {
305+
if let Some(ref mut repo) = node.repo_info {
306+
if repo.display_name == display_name {
307+
repo.operation_status = status.clone();
308+
}
309+
}
310+
update_repo_status_in_tree(&mut node.children, display_name, status.clone());
311+
}
291312
}

0 commit comments

Comments
 (0)