File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed
Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -2453,10 +2453,12 @@ def delete_profile(self) -> None:
24532453
24542454 if msg .exec () == QtWidgets .QMessageBox .StandardButton .Yes :
24552455 self .component .send_data (ipc .DeleteProfile (sanitised_profile_name ))
2456- self .mark_profiles_saved (profile_name )
24572456
2458- del self ._profile_names [sanitised_profile_name ]
2459- self ._unsaved_profiles .discard (sanitised_profile_name )
2457+ # Only remove from list if it's not the currently selected profile
2458+ if sanitised_profile_name != sanitise_profile_name (self ._current_profile .name ):
2459+ self .mark_profiles_saved (profile_name )
2460+ del self ._profile_names [sanitised_profile_name ]
2461+ self ._unsaved_profiles .discard (sanitised_profile_name )
24602462
24612463 self ._redraw_profile_combobox ()
24622464 self .profile_changed (0 )
You can’t perform that action at this time.
0 commit comments