File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -266,7 +266,10 @@ impl Default for AppConfig {
266266}
267267
268268impl AppState {
269- pub fn set_project_dir ( & mut self , path : Utf8PlatformPathBuf ) {
269+ pub fn set_project_dir ( & mut self , path : Utf8PlatformPathBuf , jobs : & mut JobQueue ) {
270+ jobs. cancel_kind ( Job :: ObjDiff ) ;
271+ jobs. cancel_kind ( Job :: FindSimilar ) ;
272+ jobs. cancel_kind ( Job :: CreateScratch ) ;
270273 self . config . recent_projects . retain ( |p| p != & path) ;
271274 if self . config . recent_projects . len ( ) > 9 {
272275 self . config . recent_projects . truncate ( 9 ) ;
@@ -498,7 +501,7 @@ impl App {
498501 if let Some ( project_dir) = project_dir
499502 && state. config . project_dir . as_ref ( ) . is_none_or ( |p| * p != project_dir)
500503 {
501- state. set_project_dir ( project_dir) ;
504+ state. set_project_dir ( project_dir, & mut app . view_state . jobs ) ;
502505 }
503506 if state. config . project_dir . is_some ( ) {
504507 state. config_change = true ;
@@ -772,7 +775,7 @@ impl eframe::App for App {
772775 state
773776 . write ( )
774777 . unwrap ( )
775- . set_project_dir ( Utf8PlatformPathBuf :: from ( path) ) ;
778+ . set_project_dir ( Utf8PlatformPathBuf :: from ( path) , jobs ) ;
776779 ui. close ( ) ;
777780 }
778781 }
Original file line number Diff line number Diff line change @@ -70,7 +70,7 @@ impl ConfigViewState {
7070 FileDialogResult :: None => { }
7171 FileDialogResult :: ProjectDir ( path) => {
7272 let mut guard = state. write ( ) . unwrap ( ) ;
73- guard. set_project_dir ( path. to_path_buf ( ) ) ;
73+ guard. set_project_dir ( path. to_path_buf ( ) , jobs ) ;
7474 }
7575 FileDialogResult :: TargetDir ( path) => {
7676 let mut guard = state. write ( ) . unwrap ( ) ;
You can’t perform that action at this time.
0 commit comments