From a331303fb1fbb2ad93ebd6a1c5c0b5ff8b44d376 Mon Sep 17 00:00:00 2001 From: Kemal Setya Adhi Date: Sun, 5 Jan 2025 16:55:19 +0700 Subject: [PATCH] Fix double logging on sophon update -> install fallback --- .../BaseClass/InstallManagerBase.Sophon.cs | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/CollapseLauncher/Classes/InstallManagement/BaseClass/InstallManagerBase.Sophon.cs b/CollapseLauncher/Classes/InstallManagement/BaseClass/InstallManagerBase.Sophon.cs index aa600698e..480484c98 100644 --- a/CollapseLauncher/Classes/InstallManagement/BaseClass/InstallManagerBase.Sophon.cs +++ b/CollapseLauncher/Classes/InstallManagement/BaseClass/InstallManagerBase.Sophon.cs @@ -147,8 +147,11 @@ public virtual async Task StartPackageInstallSophon(GameInstallStateEnum gameSta // Clear the VO language list _sophonVOLanguageList.Clear(); - // Subscribe the logger event - SophonLogger.LogHandler += UpdateSophonLogHandler; + // Subscribe the logger event if fallback is not used + if (!fallbackFromUpdate) + { + SophonLogger.LogHandler += UpdateSophonLogHandler; + } // Get the requested URL and version based on current state. if (_gameVersionManager.GamePreset @@ -437,8 +440,11 @@ await Task.Run(() => } finally { - // Unsubscribe the logger event - SophonLogger.LogHandler -= UpdateSophonLogHandler; + // Unsubscribe the logger event if fallback is not used + if (!fallbackFromUpdate) + { + SophonLogger.LogHandler -= UpdateSophonLogHandler; + } httpClient.Dispose(); // Unsubscribe download limiter