reset widget before deleting profile

This commit is contained in:
goat 2023-04-10 22:54:19 +02:00
parent 4b2f649215
commit ea01e62936
No known key found for this signature in database
GPG key ID: 49E2AA8C6A76498B

View file

@ -248,12 +248,13 @@ internal class ProfileManagerWidget
if (ImGuiComponents.IconButton(FontAwesomeIcon.Trash))
{
this.Reset();
// DeleteProfile() is sync, it doesn't apply and we are modifying the plugins collection. Will throw below when iterating
profman.DeleteProfile(profile);
Task.Run(() => profman.ApplyAllWantStates())
.ContinueWith(t =>
{
this.Reset();
this.installer.DisplayErrorContinuation(t, "Could not refresh profiles.");
});
}