From 04f7a0a4c7b0be1d6ef6afff3c810af4a56a8174 Mon Sep 17 00:00:00 2001 From: Liza Carvelli Date: Mon, 17 Jun 2024 00:30:50 +0200 Subject: [PATCH] Fix YA IPC --- Questionable/Controller/QuestController.cs | 2 +- Questionable/External/YesAlreadyIpc.cs | 14 ++++++++++---- Questionable/Questionable.csproj | 2 +- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/Questionable/Controller/QuestController.cs b/Questionable/Controller/QuestController.cs index d1a7e3e0..46adb25b 100644 --- a/Questionable/Controller/QuestController.cs +++ b/Questionable/Controller/QuestController.cs @@ -278,7 +278,7 @@ internal sealed class QuestController if (_taskQueue.Count > 0) _taskQueue.Clear(); - _yesAlreadyIpc.DisableYesAlready(); + _yesAlreadyIpc.RestoreYesAlready(); } public void Stop(string label, bool continueIfAutomatic = false) diff --git a/Questionable/External/YesAlreadyIpc.cs b/Questionable/External/YesAlreadyIpc.cs index 8b69f789..a9d20c03 100644 --- a/Questionable/External/YesAlreadyIpc.cs +++ b/Questionable/External/YesAlreadyIpc.cs @@ -18,16 +18,22 @@ internal sealed class YesAlreadyIpc : IDisposable public void DisableYesAlready() { - _pluginLog.Debug("Disabling YesAlready"); - if (_pluginInterface.TryGetData>("YesAlready.StopRequests", out var data)) + if (_pluginInterface.TryGetData>("YesAlready.StopRequests", out var data) && + !data.Contains(nameof(Questionable))) + { + _pluginLog.Debug("Disabling YesAlready"); data.Add(nameof(Questionable)); + } } public void RestoreYesAlready() { - _pluginLog.Debug("Restoring YesAlready"); - if (_pluginInterface.TryGetData>("YesAlready.StopRequests", out var data)) + if (_pluginInterface.TryGetData>("YesAlready.StopRequests", out var data) && + data.Contains(nameof(Questionable))) + { + _pluginLog.Debug("Restoring YesAlready"); data.Remove(nameof(Questionable)); + } } public void Dispose() => RestoreYesAlready(); diff --git a/Questionable/Questionable.csproj b/Questionable/Questionable.csproj index e5fdb306..2fc6155c 100644 --- a/Questionable/Questionable.csproj +++ b/Questionable/Questionable.csproj @@ -1,7 +1,7 @@  net8.0-windows - 0.16 + 0.17 12 enable true