mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2025-08-20 22:12:56 +00:00
Refactor PandocDialog to simplify state management
This commit is contained in:
parent
1330519334
commit
a6703f108d
@ -128,7 +128,7 @@
|
||||
else
|
||||
{
|
||||
<MudItem Class="px-8 py-2" Style="height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center;">
|
||||
@if (this.showSkeleton)
|
||||
@if (this.pandocInstallation == default)
|
||||
{
|
||||
<MudSkeleton SkeletonType="SkeletonType.Circle" Animation="Animation.Pulse" Class="mb-4" Style="width: 4em; height: 4em;"/>
|
||||
<MudSkeleton SkeletonType="SkeletonType.Rectangle" Animation="Animation.Pulse" Width="230px" Height="35px"/>
|
||||
|
@ -33,8 +33,7 @@ public partial class PandocDialog : ComponentBase
|
||||
private static readonly string LICENCE_URI = "https://raw.githubusercontent.com/jgm/pandoc/refs/heads/main/COPYING.md";
|
||||
private static string LATEST_PANDOC_VERSION = string.Empty;
|
||||
|
||||
private bool isPandocAvailable;
|
||||
private bool showSkeleton;
|
||||
private PandocInstallation pandocInstallation;
|
||||
private bool showInstallPage;
|
||||
private string? licenseText;
|
||||
private bool isLoadingLicence;
|
||||
@ -49,7 +48,6 @@ public partial class PandocDialog : ComponentBase
|
||||
{
|
||||
await base.OnInitializedAsync();
|
||||
|
||||
this.showSkeleton = true;
|
||||
LATEST_PANDOC_VERSION = await Pandoc.FetchLatestVersionAsync();
|
||||
await this.CheckPandocAvailabilityAsync();
|
||||
}
|
||||
@ -60,10 +58,7 @@ public partial class PandocDialog : ComponentBase
|
||||
|
||||
private async Task CheckPandocAvailabilityAsync()
|
||||
{
|
||||
var pandocInstallation = await Pandoc.CheckAvailabilityAsync(this.RustService);
|
||||
this.isPandocAvailable = pandocInstallation.IsAvailable;
|
||||
this.showSkeleton = false;
|
||||
|
||||
this.pandocInstallation = await Pandoc.CheckAvailabilityAsync(this.RustService);
|
||||
await this.InvokeAsync(this.StateHasChanged);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user