From b0906af1ba8b89c32dbe8a8c95bba31b3f8e6268 Mon Sep 17 00:00:00 2001 From: goat Date: Mon, 10 Apr 2023 21:18:23 +0200 Subject: [PATCH] prevent some collection is modified errors --- .../Windows/PluginInstaller/ProfileManagerWidget.cs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/Dalamud/Interface/Internal/Windows/PluginInstaller/ProfileManagerWidget.cs b/Dalamud/Interface/Internal/Windows/PluginInstaller/ProfileManagerWidget.cs index ab25c4c88..ebabe4436 100644 --- a/Dalamud/Interface/Internal/Windows/PluginInstaller/ProfileManagerWidget.cs +++ b/Dalamud/Interface/Internal/Windows/PluginInstaller/ProfileManagerWidget.cs @@ -206,7 +206,10 @@ internal class ProfileManagerWidget { if (ImGui.Button("Do it") && selected != null) { - Task.Run(() => profile.AddOrUpdate(selected.Manifest.InternalName, selected.IsLoaded)); + // TODO: handle error + profile.AddOrUpdate(selected.Manifest.InternalName, selected.IsLoaded, false); + Task.Run(() => profman.ApplyAllWantStates()) + .ContinueWith(this.installer.DisplayErrorContinuation, "Could not change plugin state."); } } @@ -382,7 +385,9 @@ internal class ProfileManagerWidget if (wantRemovePluginInternalName != null) { - Task.Run(() => profile.Remove(wantRemovePluginInternalName)) + // TODO: handle error + profile.Remove(wantRemovePluginInternalName, false); + Task.Run(() => profman.ApplyAllWantStates()) .ContinueWith(this.installer.DisplayErrorContinuation, "Could not remove plugin."); }