File tree Expand file tree Collapse file tree 3 files changed +268
-78
lines changed
Expand file tree Collapse file tree 3 files changed +268
-78
lines changed Original file line number Diff line number Diff 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}
You can’t perform that action at this time.
0 commit comments