@@ -81,12 +81,14 @@ pub fn config_ui(ui: &mut egui::Ui, config: &Arc<RwLock<AppConfig>>, view_state:
8181 if state. update_available {
8282 ui. colored_label ( Color32 :: LIGHT_GREEN , "Update available" ) ;
8383 ui. horizontal ( |ui| {
84- if state. found_binary && ui
84+ if state. found_binary
85+ && ui
8586 . button ( "Automatic" )
8687 . on_hover_text_at_pointer (
8788 "Automatically download and replace the current build" ,
8889 )
89- . clicked ( ) {
90+ . clicked ( )
91+ {
9092 view_state. jobs . push ( queue_update ( ) ) ;
9193 }
9294 if ui
@@ -183,20 +185,18 @@ pub fn config_ui(ui: &mut egui::Ui, config: &Arc<RwLock<AppConfig>>, view_state:
183185 ui. separator ( ) ;
184186 }
185187
186- if let Some ( base_dir) = base_obj_dir {
188+ if let ( Some ( base_dir) , Some ( target_dir ) ) = ( base_obj_dir, target_obj_dir ) {
187189 if ui. button ( "Select obj" ) . clicked ( ) {
188190 if let Some ( path) = rfd:: FileDialog :: new ( )
189- . set_directory ( & base_dir )
191+ . set_directory ( & target_dir )
190192 . add_filter ( "Object file" , & [ "o" , "elf" ] )
191193 . pick_file ( )
192194 {
193195 let mut new_build_obj: Option < String > = None ;
194196 if let Ok ( obj_path) = path. strip_prefix ( & base_dir) {
195197 new_build_obj = Some ( obj_path. display ( ) . to_string ( ) ) ;
196- } else if let Some ( build_asm_dir) = target_obj_dir {
197- if let Ok ( obj_path) = path. strip_prefix ( & build_asm_dir) {
198- new_build_obj = Some ( obj_path. display ( ) . to_string ( ) ) ;
199- }
198+ } else if let Ok ( obj_path) = path. strip_prefix ( & target_dir) {
199+ new_build_obj = Some ( obj_path. display ( ) . to_string ( ) ) ;
200200 }
201201 if let Some ( new_build_obj) = new_build_obj {
202202 * obj_path = Some ( new_build_obj) ;
0 commit comments