From 1c727909ce167a5e3cec026854ef5576f2fb6849 Mon Sep 17 00:00:00 2001 From: Justin Swanson Date: Thu, 31 Oct 2019 19:47:48 -0500 Subject: [PATCH] Offloaded slideshow preloading to background thread --- Wabbajack/View Models/SlideShow.cs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/Wabbajack/View Models/SlideShow.cs b/Wabbajack/View Models/SlideShow.cs index c54c1abb..2aaf7d46 100644 --- a/Wabbajack/View Models/SlideShow.cs +++ b/Wabbajack/View Models/SlideShow.cs @@ -81,7 +81,7 @@ namespace Wabbajack this.WhenAny(x => x.Installer.ModList) .NotNull() .ObserveOnGuiThread() - .Subscribe(modList => + .Do(modList => { this.NexusSiteURL = modList.Website; this.ModName = modList.Name; @@ -95,9 +95,14 @@ namespace Wabbajack new Slide(NexusApiUtils.FixupSummary(m.ModName), m.ModID, NexusApiUtils.FixupSummary(m.Summary), NexusApiUtils.FixupSummary(m.Author), m.Adult, m.NexusURL, m.SlideShowPic)).ToList(); - + }) + .ObserveOn(RxApp.TaskpoolScheduler) + .Do(modList => + { + // This takes a while, and is currently blocking this.PreloadSlideShow(); }) + .Subscribe() .DisposeWith(this.CompositeDisposable); /// Wire slideshow updates