mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2025-08-21 01:52:57 +00:00
Add ShowInitialResultInSnackbar parameter to PandocDialog
This commit is contained in:
parent
4635fe732a
commit
9b8f2e5fc7
@ -17,6 +17,9 @@ public partial class PandocDialog : ComponentBase
|
|||||||
[Parameter]
|
[Parameter]
|
||||||
public bool ShowInstallationPage { get; set; }
|
public bool ShowInstallationPage { get; set; }
|
||||||
|
|
||||||
|
[Parameter]
|
||||||
|
public bool ShowInitialResultInSnackbar { get; set; } = true;
|
||||||
|
|
||||||
[Inject]
|
[Inject]
|
||||||
private HttpClient HttpClient { get; set; } = null!;
|
private HttpClient HttpClient { get; set; } = null!;
|
||||||
|
|
||||||
@ -48,16 +51,16 @@ public partial class PandocDialog : ComponentBase
|
|||||||
await base.OnInitializedAsync();
|
await base.OnInitializedAsync();
|
||||||
|
|
||||||
LATEST_PANDOC_VERSION = await Pandoc.FetchLatestVersionAsync();
|
LATEST_PANDOC_VERSION = await Pandoc.FetchLatestVersionAsync();
|
||||||
await this.CheckPandocAvailabilityAsync();
|
await this.CheckPandocAvailabilityAsync(this.ShowInitialResultInSnackbar);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
private void Cancel() => this.MudDialog.Cancel();
|
private void Cancel() => this.MudDialog.Cancel();
|
||||||
|
|
||||||
private async Task CheckPandocAvailabilityAsync()
|
private async Task CheckPandocAvailabilityAsync(bool useSnackbar)
|
||||||
{
|
{
|
||||||
this.pandocInstallation = await Pandoc.CheckAvailabilityAsync(this.RustService);
|
this.pandocInstallation = await Pandoc.CheckAvailabilityAsync(this.RustService, useSnackbar);
|
||||||
await this.InvokeAsync(this.StateHasChanged);
|
await this.InvokeAsync(this.StateHasChanged);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -100,6 +100,7 @@ public partial class About : MSGComponentBase
|
|||||||
var dialogParameters = new DialogParameters<PandocDialog>
|
var dialogParameters = new DialogParameters<PandocDialog>
|
||||||
{
|
{
|
||||||
{ x => x.ShowInstallationPage, true },
|
{ x => x.ShowInstallationPage, true },
|
||||||
|
{ x => x.ShowInitialResultInSnackbar, false },
|
||||||
};
|
};
|
||||||
|
|
||||||
await this.DialogService.ShowAsync<PandocDialog>(T("Pandoc Installation"), dialogParameters, DialogOptions.FULLSCREEN);
|
await this.DialogService.ShowAsync<PandocDialog>(T("Pandoc Installation"), dialogParameters, DialogOptions.FULLSCREEN);
|
||||||
|
Loading…
Reference in New Issue
Block a user