From 7b1583085a3a4f0cb630295bcbdd71dab985d418 Mon Sep 17 00:00:00 2001 From: eoineoineoin Date: Wed, 5 Nov 2025 09:29:07 +0000 Subject: [PATCH] Fix changelog button always indicating new changes. (#41277) * Refresh changelog button when ServerId is changed * Listen to specific cvar being changed --- Content.Client/Changelog/ChangelogManager.cs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/Content.Client/Changelog/ChangelogManager.cs b/Content.Client/Changelog/ChangelogManager.cs index 657d0cb3ac..545d001aab 100644 --- a/Content.Client/Changelog/ChangelogManager.cs +++ b/Content.Client/Changelog/ChangelogManager.cs @@ -52,6 +52,7 @@ namespace Content.Client.Changelog // Open changelog purely to compare to the last viewed date. var changelogs = await LoadChangelog(); UpdateChangelogs(changelogs); + _configManager.OnValueChanged(CCVars.ServerId, OnServerIdCVarChanged); } private void UpdateChangelogs(List changelogs) @@ -81,6 +82,11 @@ namespace Content.Client.Changelog MaxId = changelog.Entries.Max(c => c.Id); + CheckLastSeenEntry(); + } + + private void CheckLastSeenEntry() + { var path = new ResPath($"/changelog_last_seen_{_configManager.GetCVar(CCVars.ServerId)}"); if (_resource.UserData.TryReadAllText(path, out var lastReadIdText)) { @@ -92,6 +98,11 @@ namespace Content.Client.Changelog NewChangelogEntriesChanged?.Invoke(); } + private void OnServerIdCVarChanged(string newValue) + { + CheckLastSeenEntry(); + } + public Task> LoadChangelog() { return Task.Run(() => -- 2.51.2