@@ -81,12 +81,14 @@ pub fn config_ui(ui: &mut egui::Ui, config: &Arc<RwLock<AppConfig>>, view_state:
81
81
if state. update_available {
82
82
ui. colored_label ( Color32 :: LIGHT_GREEN , "Update available" ) ;
83
83
ui. horizontal ( |ui| {
84
- if state. found_binary && ui
84
+ if state. found_binary
85
+ && ui
85
86
. button ( "Automatic" )
86
87
. on_hover_text_at_pointer (
87
88
"Automatically download and replace the current build" ,
88
89
)
89
- . clicked ( ) {
90
+ . clicked ( )
91
+ {
90
92
view_state. jobs . push ( queue_update ( ) ) ;
91
93
}
92
94
if ui
@@ -183,20 +185,18 @@ pub fn config_ui(ui: &mut egui::Ui, config: &Arc<RwLock<AppConfig>>, view_state:
183
185
ui. separator ( ) ;
184
186
}
185
187
186
- if let Some ( base_dir) = base_obj_dir {
188
+ if let ( Some ( base_dir) , Some ( target_dir ) ) = ( base_obj_dir, target_obj_dir ) {
187
189
if ui. button ( "Select obj" ) . clicked ( ) {
188
190
if let Some ( path) = rfd:: FileDialog :: new ( )
189
- . set_directory ( & base_dir )
191
+ . set_directory ( & target_dir )
190
192
. add_filter ( "Object file" , & [ "o" , "elf" ] )
191
193
. pick_file ( )
192
194
{
193
195
let mut new_build_obj: Option < String > = None ;
194
196
if let Ok ( obj_path) = path. strip_prefix ( & base_dir) {
195
197
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 ( ) ) ;
200
200
}
201
201
if let Some ( new_build_obj) = new_build_obj {
202
202
* obj_path = Some ( new_build_obj) ;
0 commit comments