mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-02-13 06:01:37 +00:00
Improved pandoc aailability check
This commit is contained in:
parent
2c9b6f10dc
commit
4dd64656e5
@ -76,10 +76,19 @@ public partial class AttachDocuments : MSGComponentBase
|
||||
}
|
||||
|
||||
// Ensure that Pandoc is installed and ready:
|
||||
await this.PandocAvailabilityService.EnsureAvailabilityAsync(
|
||||
var pandocState = await this.PandocAvailabilityService.EnsureAvailabilityAsync(
|
||||
showSuccessMessage: false,
|
||||
showDialog: true);
|
||||
|
||||
// If Pandoc is not available (user cancelled installation), abort file drop:
|
||||
if (!pandocState.IsAvailable)
|
||||
{
|
||||
this.Logger.LogInformation("The user cancelled the Pandoc installation or Pandoc is not available. Aborting file drop.");
|
||||
this.ClearDragClass();
|
||||
this.StateHasChanged();
|
||||
return;
|
||||
}
|
||||
|
||||
foreach (var path in paths)
|
||||
{
|
||||
if(!await this.IsFileExtensionValid(path))
|
||||
@ -106,10 +115,17 @@ public partial class AttachDocuments : MSGComponentBase
|
||||
private async Task AddFilesManually()
|
||||
{
|
||||
// Ensure that Pandoc is installed and ready:
|
||||
await this.PandocAvailabilityService.EnsureAvailabilityAsync(
|
||||
var pandocState = await this.PandocAvailabilityService.EnsureAvailabilityAsync(
|
||||
showSuccessMessage: false,
|
||||
showDialog: true);
|
||||
|
||||
// If Pandoc is not available (user cancelled installation), abort file selection:
|
||||
if (!pandocState.IsAvailable)
|
||||
{
|
||||
this.Logger.LogInformation("The user cancelled the Pandoc installation or Pandoc is not available. Aborting file selection.");
|
||||
return;
|
||||
}
|
||||
|
||||
var selectedFile = await this.RustService.SelectFile(T("Select a file to attach"));
|
||||
if (selectedFile.UserCancelled)
|
||||
return;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user