Fix double navigation bug
MODIFY
WalletWasabi.Fluent/ViewModels/Dialogs/ShowQrCameraDialogViewModel.cs
WalletWasabi.Fluent/ViewModels/Dialogs/ShowQrCameraDialogViewModel.cs
@@ -53,16 +53,29 @@ public partial class ShowQrCameraDialogViewModel : DialogViewModelBase<string?>
.ObserveOn(RxApp.MainThreadScheduler)
.SubscribeAsync(async args =>
{
- Close();
await ShowErrorAsync(
Title,
args.EventArgs.Message,
"Something went wrong");
+
+ Close();
})
.DisposeWith(disposables);
- disposables.Add(Disposable.Create(() => RxApp.MainThreadScheduler.Schedule(async () => await _qrReader.StopAsync(CancellationToken.None))));
+ if (!isInHistory)
+ {
RxApp.MainThreadScheduler.Schedule(async () => await _qrReader.StartAsync(CancellationTokenSource.Token));
}
}
+
+ protected override void OnNavigatedFrom(bool isInHistory)
+ {
+ base.OnNavigatedFrom(isInHistory);
+
+ if (!isInHistory)
+ {
+ RxApp.MainThreadScheduler.Schedule(async () => await _qrReader.StopAsync(CancellationToken.None));
+ }
+ }
+}

Fix double navigation bug