fix: don't draw changelog twice

This commit is contained in:
goat 2023-08-22 21:49:38 +02:00
parent 47a9911e31
commit 07692753db
No known key found for this signature in database
GPG key ID: 49E2AA8C6A76498B

View file

@ -2149,6 +2149,7 @@ internal class PluginInstallerWindow : Window, IDisposable
ImGui.PushID($"installed{index}{plugin.Manifest.InternalName}"); ImGui.PushID($"installed{index}{plugin.Manifest.InternalName}");
var hasChangelog = !plugin.Manifest.Changelog.IsNullOrEmpty(); var hasChangelog = !plugin.Manifest.Changelog.IsNullOrEmpty();
var didDrawChangelogInsideCollapsible = false;
if (this.DrawPluginCollapsingHeader(label, plugin, plugin.Manifest, plugin.IsThirdParty, trouble, availablePluginUpdate != default, false, false, plugin.IsOrphaned, () => this.DrawInstalledPluginContextMenu(plugin, testingOptIn), index)) if (this.DrawPluginCollapsingHeader(label, plugin, plugin.Manifest, plugin.IsThirdParty, trouble, availablePluginUpdate != default, false, false, plugin.IsOrphaned, () => this.DrawInstalledPluginContextMenu(plugin, testingOptIn), index))
{ {
@ -2257,6 +2258,7 @@ internal class PluginInstallerWindow : Window, IDisposable
{ {
if (ImGui.TreeNode(Locs.PluginBody_CurrentChangeLog(plugin.EffectiveVersion))) if (ImGui.TreeNode(Locs.PluginBody_CurrentChangeLog(plugin.EffectiveVersion)))
{ {
didDrawChangelogInsideCollapsible = true;
this.DrawInstalledPluginChangelog(plugin.Manifest); this.DrawInstalledPluginChangelog(plugin.Manifest);
ImGui.TreePop(); ImGui.TreePop();
} }
@ -2273,7 +2275,7 @@ internal class PluginInstallerWindow : Window, IDisposable
} }
} }
if (thisWasUpdated && hasChangelog) if (thisWasUpdated && hasChangelog && !didDrawChangelogInsideCollapsible)
{ {
this.DrawInstalledPluginChangelog(plugin.Manifest); this.DrawInstalledPluginChangelog(plugin.Manifest);
} }