diff --git a/Wabbajack.Lib/UI/FilePickerVM.cs b/Wabbajack.Lib/UI/FilePickerVM.cs index c7e49d17..b087fe19 100644 --- a/Wabbajack.Lib/UI/FilePickerVM.cs +++ b/Wabbajack.Lib/UI/FilePickerVM.cs @@ -1,4 +1,4 @@ -using DynamicData; +using DynamicData; using Microsoft.WindowsAPICodePack.Dialogs; using ReactiveUI; using ReactiveUI.Fody.Helpers; @@ -80,7 +80,7 @@ namespace Wabbajack.Lib this.WhenAny(x => x.TargetPath) // Dont want to debounce the initial value, because we know it's null .Skip(1) - .Debounce(TimeSpan.FromMilliseconds(200)) + .Debounce(TimeSpan.FromMilliseconds(200), RxApp.TaskpoolScheduler) .StartWith(default(string)), resultSelector: (existsOption, type, path) => (ExistsOption: existsOption, Type: type, Path: path)) .StartWith((ExistsOption: ExistCheckOption, Type: PathType, Path: TargetPath)) @@ -107,7 +107,7 @@ namespace Wabbajack.Lib .Replay(1) .RefCount(); - _exists = Observable.Interval(TimeSpan.FromSeconds(3)) + _exists = Observable.Interval(TimeSpan.FromSeconds(3), RxApp.TaskpoolScheduler) // Only check exists on timer if desired .FilterSwitch(doExistsCheck) .Unit() @@ -119,6 +119,7 @@ namespace Wabbajack.Lib .CombineLatest(existsCheckTuple, resultSelector: (_, tuple) => tuple) // Refresh exists + .ObserveOn(RxApp.TaskpoolScheduler) .Select(t => { switch (t.ExistsOption) @@ -146,7 +147,7 @@ namespace Wabbajack.Lib } }) .DistinctUntilChanged() - .ObserveOn(RxApp.MainThreadScheduler) + .ObserveOnGuiThread() .StartWith(false) .ToProperty(this, nameof(Exists)); @@ -217,6 +218,7 @@ namespace Wabbajack.Lib if (filter.Failed) return filter; return ErrorResponse.Convert(err); }) + .ObserveOnGuiThread() .ToProperty(this, nameof(ErrorState)); _inError = this.WhenAny(x => x.ErrorState) @@ -242,6 +244,7 @@ namespace Wabbajack.Lib if (!string.IsNullOrWhiteSpace(filters)) return filters; return err?.Reason; }) + .ObserveOnGuiThread() .ToProperty(this, nameof(ErrorTooltip)); } diff --git a/Wabbajack/View Models/Compilers/CompilerVM.cs b/Wabbajack/View Models/Compilers/CompilerVM.cs index 136cc742..dfee34c5 100644 --- a/Wabbajack/View Models/Compilers/CompilerVM.cs +++ b/Wabbajack/View Models/Compilers/CompilerVM.cs @@ -114,8 +114,9 @@ namespace Wabbajack _image = this.WhenAny(x => x.CurrentModlistSettings.ImagePath.TargetPath) // Throttle so that it only loads image after any sets of swaps have completed - .Throttle(TimeSpan.FromMilliseconds(50), RxApp.MainThreadScheduler) + .Throttle(TimeSpan.FromMilliseconds(50), RxApp.TaskpoolScheduler) .DistinctUntilChanged() + .ObserveOn(RxApp.MainThreadScheduler) .Select(path => { if (string.IsNullOrWhiteSpace(path)) return UIUtils.BitmapImageFromResource("Resources/Wabba_Mouth_No_Text.png"); diff --git a/Wabbajack/View Models/Installers/MO2InstallerVM.cs b/Wabbajack/View Models/Installers/MO2InstallerVM.cs index 3982a31b..a0909b96 100644 --- a/Wabbajack/View Models/Installers/MO2InstallerVM.cs +++ b/Wabbajack/View Models/Installers/MO2InstallerVM.cs @@ -59,7 +59,7 @@ namespace Wabbajack this.WhenAny(x => x.Location.TargetPath), this.WhenAny(x => x.DownloadLocation.TargetPath), resultSelector: (target, download) => (target, download)) - .ObserveOn(RxApp.MainThreadScheduler) + .ObserveOn(RxApp.TaskpoolScheduler) .Select(i => MO2Installer.CheckValidInstallPath(i.target, i.download)) .ObserveOnGuiThread();