mirror of
https://github.com/immense/Remotely.git
synced 2025-10-26 11:27:15 +00:00
Upload file on UIThread so progress events reach controls.
This commit is contained in:
parent
f411c14334
commit
6b873f9cc4
@ -1,4 +1,5 @@
|
||||
using Avalonia.Controls;
|
||||
using Avalonia.Threading;
|
||||
using ReactiveUI;
|
||||
using Remotely.Desktop.Core.Interfaces;
|
||||
using Remotely.Desktop.Core.Services;
|
||||
@ -80,12 +81,15 @@ namespace Remotely.Desktop.Linux.ViewModels
|
||||
|
||||
public async Task UploadFile(string filePath)
|
||||
{
|
||||
var fileUpload = new FileUpload()
|
||||
await Dispatcher.UIThread.InvokeAsync(async () =>
|
||||
{
|
||||
FilePath = filePath
|
||||
};
|
||||
FileUploads.Add(fileUpload);
|
||||
await _fileTransferService.UploadFile(fileUpload, _viewer);
|
||||
var fileUpload = new FileUpload()
|
||||
{
|
||||
FilePath = filePath
|
||||
};
|
||||
FileUploads.Add(fileUpload);
|
||||
await _fileTransferService.UploadFile(fileUpload, _viewer);
|
||||
});
|
||||
}
|
||||
|
||||
public ICommand RemoveFileUpload => new Executor((param) =>
|
||||
|
||||
@ -94,12 +94,15 @@ namespace Remotely.Desktop.Win.ViewModels
|
||||
|
||||
public async Task UploadFile(string filePath)
|
||||
{
|
||||
var fileUpload = new FileUpload()
|
||||
await App.Current.Dispatcher.InvokeAsync(async () =>
|
||||
{
|
||||
FilePath = filePath
|
||||
};
|
||||
FileUploads.Add(fileUpload);
|
||||
await _fileTransferService.UploadFile(fileUpload, _viewer);
|
||||
var fileUpload = new FileUpload()
|
||||
{
|
||||
FilePath = filePath
|
||||
};
|
||||
FileUploads.Add(fileUpload);
|
||||
await _fileTransferService.UploadFile(fileUpload, _viewer);
|
||||
});
|
||||
}
|
||||
|
||||
public ICommand RemoveFileUpload => new Executor((param) =>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user