From f771e03d5e9e8e8087ca9ddb52fc5fc73753f492 Mon Sep 17 00:00:00 2001 From: Scighost Date: Sat, 25 May 2024 15:36:09 +0800 Subject: [PATCH] improve markdown content --- src/Starward/MyWindows/UpdateContentWindow.xaml.cs | 7 +++++++ src/Starward/Pages/UpdatePage.xaml.cs | 2 -- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/Starward/MyWindows/UpdateContentWindow.xaml.cs b/src/Starward/MyWindows/UpdateContentWindow.xaml.cs index d021bbe97..d75f2f722 100644 --- a/src/Starward/MyWindows/UpdateContentWindow.xaml.cs +++ b/src/Starward/MyWindows/UpdateContentWindow.xaml.cs @@ -107,6 +107,7 @@ private async Task LoadPageAsync() var releases = await _metadataClient.GetGithubReleaseAsync(1, 20); var markdown = new StringBuilder(); + int count = 0; foreach (var release in releases) { if (NuGetVersion.TryParse(release.TagName, out var version)) @@ -120,6 +121,7 @@ private async Task LoadPageAsync() markdown.AppendLine(release.Body); markdown.AppendLine("
"); markdown.AppendLine(); + count++; } } } @@ -130,6 +132,11 @@ private async Task LoadPageAsync() markdown.AppendLine(release.Body); markdown.AppendLine("
"); markdown.AppendLine(); + count++; + } + if (count >= 10) + { + break; } } if (markdown.Length == 0) diff --git a/src/Starward/Pages/UpdatePage.xaml.cs b/src/Starward/Pages/UpdatePage.xaml.cs index 2825179e0..6c1e46ab0 100644 --- a/src/Starward/Pages/UpdatePage.xaml.cs +++ b/src/Starward/Pages/UpdatePage.xaml.cs @@ -139,8 +139,6 @@ private async Task ShowGithubReleaseAsync(string tag) string markdown = $""" # {release.Name} - > Update at {release.PublishedAt.LocalDateTime:yyyy-MM-dd HH:mm:ss} - {release.Body} """;