Improved the loading of some components that require data fetching (#512)

This commit is contained in:
Thorsten Sommer authored and GitHub committed 2025-06-27 20:52:33 +02:00
1 parent 3587f547b5
commit 181ba07d2d
5 files changed
+29 -18

No files matched your search

+4 -1
View File
@@ -66,7 +66,10 @@ public partial class About : MSGComponentBase
this.logPaths = await this.RustService.GetLogPaths();
await base.OnInitializedAsync();
await this.DeterminePandocVersion();
// Determine the Pandoc version may take some time, so we start it here
// without waiting for the result:
_ = this.DeterminePandocVersion();
}
#endregion
+6 -2
View File
@@ -19,10 +19,12 @@ public partial class Home : MSGComponentBase
protected override async Task OnInitializedAsync()
{
await this.ReadLastChangeAsync();
await base.OnInitializedAsync();
this.InitializeAdvantagesItems();
// Read the last change content asynchronously
// without blocking the UI thread:
_ = this.ReadLastChangeAsync();
}
private void InitializeAdvantagesItems()
@@ -61,6 +63,8 @@ public partial class Home : MSGComponentBase
var latest = Changelog.LOGS.MaxBy(n => n.Build);
using var response = await this.HttpClient.GetAsync($"changelog/{latest.Filename}");
this.LastChangeContent = await response.Content.ReadAsStringAsync();
await this.InvokeAsync(this.StateHasChanged);
}
private const string QUICK_START_GUIDE =