File tree Expand file tree Collapse file tree 1 file changed +17
-7
lines changed Expand file tree Collapse file tree 1 file changed +17
-7
lines changed Original file line number Diff line number Diff line change @@ -267,15 +267,25 @@ impl AppState {
267267 }
268268
269269 pub fn set_selected_obj ( & mut self , config : ObjectConfig ) {
270- if self . config . selected_obj . as_ref ( ) . is_some_and ( |existing| existing == & config) {
271- // Don't reload the object if there were no changes
272- return ;
270+ let mut unit_changed = true ;
271+ if let Some ( existing) = self . config . selected_obj . as_ref ( ) {
272+ if existing == & config {
273+ // Don't reload the object if there were no changes
274+ return ;
275+ }
276+ if existing. name == config. name {
277+ unit_changed = false ;
278+ }
273279 }
274280 self . config . selected_obj = Some ( config) ;
275- self . obj_change = true ;
276- self . queue_build = false ;
277- self . selecting_left = None ;
278- self . selecting_right = None ;
281+ if unit_changed {
282+ self . obj_change = true ;
283+ self . queue_build = false ;
284+ self . selecting_left = None ;
285+ self . selecting_right = None ;
286+ } else {
287+ self . queue_build = true ;
288+ }
279289 }
280290
281291 pub fn clear_selected_obj ( & mut self ) {
You can’t perform that action at this time.
0 commit comments