Add ShowInitialResultInSnackbar parameter to PandocDialog

This commit is contained in:
Thorsten Sommer 2025-05-30 14:42:06 +02:00
parent 4635fe732a
commit 9b8f2e5fc7
Signed by: tsommer
GPG Key ID: 371BBA77A02C0108
2 changed files with 7 additions and 3 deletions

View File

@ -16,6 +16,9 @@ public partial class PandocDialog : ComponentBase
[Parameter]
public bool ShowInstallationPage { get; set; }
[Parameter]
public bool ShowInitialResultInSnackbar { get; set; } = true;
[Inject]
private HttpClient HttpClient { get; set; } = null!;
@ -48,16 +51,16 @@ public partial class PandocDialog : ComponentBase
await base.OnInitializedAsync();
LATEST_PANDOC_VERSION = await Pandoc.FetchLatestVersionAsync();
await this.CheckPandocAvailabilityAsync();
await this.CheckPandocAvailabilityAsync(this.ShowInitialResultInSnackbar);
}
#endregion
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);
}

View File

@ -100,6 +100,7 @@ public partial class About : MSGComponentBase
var dialogParameters = new DialogParameters<PandocDialog>
{
{ x => x.ShowInstallationPage, true },
{ x => x.ShowInitialResultInSnackbar, false },
};
await this.DialogService.ShowAsync<PandocDialog>(T("Pandoc Installation"), dialogParameters, DialogOptions.FULLSCREEN);