Swapped calls to ObserveOnGuiThread()

This commit is contained in:
Justin Swanson 2020-01-08 21:22:49 -06:00
parent 88d9d5e6d2
commit 36a37a04a9
8 changed files with 12 additions and 12 deletions

View File

@ -42,10 +42,10 @@ namespace Wabbajack.Lib.Downloaders
TriggerLogin = ReactiveCommand.CreateFromTask(
execute: () => Utils.CatchAndLog(async () => await Utils.Log(new RequestSiteLogin(this)).Task),
canExecute: IsLoggedIn.Select(b => !b).ObserveOn(RxApp.MainThreadScheduler));
canExecute: IsLoggedIn.Select(b => !b).ObserveOnGuiThread());
ClearLogin = ReactiveCommand.Create(
execute: () => Utils.CatchAndLog(() => Utils.DeleteEncryptedJson(_encryptedKeyName)),
canExecute: IsLoggedIn.ObserveOn(RxApp.MainThreadScheduler));
canExecute: IsLoggedIn.ObserveOnGuiThread());
}
public ICommand TriggerLogin { get; }

View File

@ -42,10 +42,10 @@ namespace Wabbajack.Lib.Downloaders
TriggerLogin = ReactiveCommand.CreateFromTask(
execute: () => Utils.CatchAndLog(NexusApiClient.RequestAndCacheAPIKey),
canExecute: IsLoggedIn.Select(b => !b).ObserveOn(RxApp.MainThreadScheduler));
canExecute: IsLoggedIn.Select(b => !b).ObserveOnGuiThread());
ClearLogin = ReactiveCommand.Create(
execute: () => Utils.CatchAndLog(() => Utils.DeleteEncryptedJson("nexusapikey")),
canExecute: IsLoggedIn.ObserveOn(RxApp.MainThreadScheduler));
canExecute: IsLoggedIn.ObserveOnGuiThread());
}
public async Task<AbstractDownloadState> GetDownloaderState(dynamic archiveINI)

View File

@ -1,4 +1,4 @@
using DynamicData;
using DynamicData;
using DynamicData.Binding;
using ReactiveUI;
using ReactiveUI.Fody.Helpers;
@ -123,7 +123,7 @@ namespace Wabbajack
// Throttle so that it only loads image after any sets of swaps have completed
.Throttle(TimeSpan.FromMilliseconds(50), RxApp.TaskpoolScheduler)
.DistinctUntilChanged()
.ObserveOn(RxApp.MainThreadScheduler)
.ObserveOnGuiThread()
.Select(path =>
{
if (string.IsNullOrWhiteSpace(path)) return UIUtils.BitmapImageFromResource("Resources/Wabba_Mouth_No_Text.png");
@ -172,8 +172,8 @@ namespace Wabbajack
.Batch(TimeSpan.FromMilliseconds(50), RxApp.TaskpoolScheduler)
.EnsureUniqueChanges()
.Filter(i => i.Status.IsWorking && i.Status.ID != WorkQueue.UnassignedCpuId)
.ObserveOn(RxApp.MainThreadScheduler)
.Sort(SortExpressionComparer<CPUDisplayVM>.Ascending(s => s.StartTime))
.ObserveOnGuiThread()
.Bind(StatusList)
.Subscribe()
.DisposeWith(CompositeDisposable);

View File

@ -317,7 +317,7 @@ namespace Wabbajack
.Batch(TimeSpan.FromMilliseconds(50), RxApp.TaskpoolScheduler)
.EnsureUniqueChanges()
.Filter(i => i.Status.IsWorking && i.Status.ID != WorkQueue.UnassignedCpuId)
.ObserveOn(RxApp.MainThreadScheduler)
.ObserveOnGuiThread()
.Sort(SortExpressionComparer<CPUDisplayVM>.Ascending(s => s.StartTime))
.Bind(StatusList)
.Subscribe()

View File

@ -63,8 +63,8 @@ namespace Wabbajack
.ToObservableChangeSet()
.Buffer(TimeSpan.FromMilliseconds(250), RxApp.TaskpoolScheduler)
.Where(l => l.Count > 0)
.ObserveOn(RxApp.MainThreadScheduler)
.FlattenBufferResult()
.ObserveOnGuiThread()
.Bind(Log)
.Subscribe()
.DisposeWith(CompositeDisposable);

View File

@ -67,7 +67,7 @@ namespace Wabbajack
return default(MemoryStream);
}
})
.ObserveOn(RxApp.MainThreadScheduler)
.ObserveOnGuiThread()
.Select(memStream =>
{
if (memStream == null) return default(BitmapImage);

View File

@ -64,7 +64,7 @@ namespace Wabbajack
return default;
}
})
.ObserveOn(RxApp.MainThreadScheduler)
.ObserveOnGuiThread()
.Select(memStream =>
{
if (memStream == null) return default;

View File

@ -108,7 +108,7 @@ namespace Wabbajack
return query.Items.ElementAtOrDefault(index);
})
.StartWith(default(ModVM))
.ObserveOn(RxApp.MainThreadScheduler)
.ObserveOnGuiThread()
.ToProperty(this, nameof(TargetMod));
// Mark interest and materialize image of target mod