Skip to content

Commit

Permalink
Fix double logging on sophon update -> install fallback
Browse files Browse the repository at this point in the history
  • Loading branch information
neon-nyan committed Jan 5, 2025
1 parent f76517c commit a331303
Showing 1 changed file with 10 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit a331303

Please sign in to comment.