File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -263,7 +263,10 @@ impl Default for AppConfig {
263263}
264264
265265impl AppState {
266- pub fn set_project_dir ( & mut self , path : Utf8PlatformPathBuf ) {
266+ pub fn set_project_dir ( & mut self , path : Utf8PlatformPathBuf , jobs : & mut JobQueue ) {
267+ jobs. cancel_kind ( Job :: ObjDiff ) ;
268+ jobs. cancel_kind ( Job :: FindSimilar ) ;
269+ jobs. cancel_kind ( Job :: CreateScratch ) ;
267270 self . config . recent_projects . retain ( |p| p != & path) ;
268271 if self . config . recent_projects . len ( ) > 9 {
269272 self . config . recent_projects . truncate ( 9 ) ;
@@ -495,7 +498,7 @@ impl App {
495498 if let Some ( project_dir) = project_dir
496499 && state. config . project_dir . as_ref ( ) . is_none_or ( |p| * p != project_dir)
497500 {
498- state. set_project_dir ( project_dir) ;
501+ state. set_project_dir ( project_dir, & mut app . view_state . jobs ) ;
499502 }
500503 if state. config . project_dir . is_some ( ) {
501504 state. config_change = true ;
@@ -769,7 +772,7 @@ impl eframe::App for App {
769772 state
770773 . write ( )
771774 . unwrap ( )
772- . set_project_dir ( Utf8PlatformPathBuf :: from ( path) ) ;
775+ . set_project_dir ( Utf8PlatformPathBuf :: from ( path) , jobs ) ;
773776 ui. close ( ) ;
774777 }
775778 }
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