fix #5074: generate cancellation token for file upload

This commit is contained in:
David Montesinos
2025-02-07 09:11:52 +01:00
parent fc81bae9b7
commit 0741ce2197
2 changed files with 10 additions and 3 deletions

View File

@ -4,6 +4,7 @@ using System.Threading.Tasks;
using System.Text.Json;
using System.Collections.Generic;
using System.Linq;
using System.Threading;
namespace Oqtane.UI
{
@ -214,12 +215,12 @@ namespace Oqtane.UI
return Task.CompletedTask;
}
public ValueTask<bool> UploadFiles(string posturl, string folder, string id, string antiforgerytoken, string jwt, int chunksize)
public ValueTask<bool> UploadFiles(string posturl, string folder, string id, string antiforgerytoken, string jwt, int chunksize, CancellationToken cancellationToken = default)
{
try
{
return _jsRuntime.InvokeAsync<bool>(
"Oqtane.Interop.uploadFiles",
"Oqtane.Interop.uploadFiles", cancellationToken,
posturl, folder, id, antiforgerytoken, jwt, chunksize);
}
catch