SHOWING changelog everytime till the got it button is pressed, should reappear on version updates according to the current settings

This commit is contained in:
choco
2025-10-16 23:03:32 +02:00
parent 9170b5205c
commit 8fdff1eb18
2 changed files with 14 additions and 14 deletions

View File

@@ -159,22 +159,14 @@ public class LightlessPlugin : MediatorSubscriberBase, IHostedService
var currentVersion = ver == null ? string.Empty : $"{ver.Major}.{ver.Minor}.{ver.Build}";
var lastSeen = _lightlessConfigService.Current.LastSeenVersion ?? string.Empty;
Logger?.LogDebug("Last seen version: {lastSeen}, current version: {currentVersion}", lastSeen, currentVersion);
// for testing c:
// Mediator.Publish(new UiToggleMessage(typeof(UpdateNotesUi)));
if (string.IsNullOrEmpty(lastSeen))
// Show update notes if version has changed and user has valid setup
if (!string.IsNullOrEmpty(lastSeen) &&
!string.Equals(lastSeen, currentVersion, StringComparison.Ordinal) &&
_lightlessConfigService.Current.HasValidSetup() &&
_serverConfigurationManager.HasValidConfig())
{
_lightlessConfigService.Current.LastSeenVersion = currentVersion;
_lightlessConfigService.Save();
}
else if (!string.Equals(lastSeen, currentVersion, StringComparison.Ordinal))
{
if (_lightlessConfigService.Current.HasValidSetup() && _serverConfigurationManager.HasValidConfig())
{
Mediator.Publish(new UiToggleMessage(typeof(UpdateNotesUi)));
}
_lightlessConfigService.Current.LastSeenVersion = currentVersion;
_lightlessConfigService.Save();
Mediator.Publish(new UiToggleMessage(typeof(UpdateNotesUi)));
}
#if !DEBUG