Resolve more than one running task issue
MODIFY
WalletWasabi.Fluent/Models/WebcamQrReader.cs
WalletWasabi.Fluent/Models/WebcamQrReader.cs
@@ -30,6 +30,8 @@ namespace WalletWasabi.Fluent.Models
}
public void StartScanning()
+ {
+ if (ScanningTask is not { })
{
ScanningTask = Task.Run(() =>
{
@@ -51,6 +53,7 @@ namespace WalletWasabi.Fluent.Models
}
});
}
+ }
public async Task StopScanningAsync()
{
@@ -58,6 +61,7 @@ namespace WalletWasabi.Fluent.Models
{
RequestEnd = true;
await task;
+ ScanningTask = null;
}
}

MODIFY
WalletWasabi.Fluent/ViewModels/Wallets/Send/SendViewModel.cs
WalletWasabi.Fluent/ViewModels/Wallets/Send/SendViewModel.cs
@@ -440,7 +440,6 @@ namespace WalletWasabi.Fluent.ViewModels.Wallets.Send
base.OnNavigatedFrom(isInHistory);
_lastXAxisCurrentValue = XAxisCurrentValue;
_transactionInfo.ConfirmationTimeSpan = CalculateConfirmationTime(_lastXAxisCurrentValue);
- Logger.LogWarning("Exiting");
RxApp.MainThreadScheduler.Schedule(async () => await _qrReader.StopScanningAsync());
}

Resolve more than one running task issue