From cefe52f42e0eac8504522d47ffa55f81372c41b2 Mon Sep 17 00:00:00 2001 From: Justin Swanson Date: Thu, 14 Nov 2019 23:31:46 -0600 Subject: [PATCH] CompilerVM image throttles input, and is distinct --- Wabbajack/View Models/Compilers/CompilerVM.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Wabbajack/View Models/Compilers/CompilerVM.cs b/Wabbajack/View Models/Compilers/CompilerVM.cs index d6454a1a..4e2106e7 100644 --- a/Wabbajack/View Models/Compilers/CompilerVM.cs +++ b/Wabbajack/View Models/Compilers/CompilerVM.cs @@ -66,8 +66,9 @@ namespace Wabbajack .ToProperty(this, nameof(this.CurrentModlistSettings)); this._Image = this.WhenAny(x => x.CurrentModlistSettings.ImagePath.TargetPath) - // Delay so the initial VM swap comes in immediately, image comes right after - .DelayInitial(TimeSpan.FromMilliseconds(50), RxApp.MainThreadScheduler) + // Throttle so that it only loads image after any sets of swaps have completed + .Throttle(TimeSpan.FromMilliseconds(50), RxApp.MainThreadScheduler) + .DistinctUntilChanged() .Select(path => { if (string.IsNullOrWhiteSpace(path)) return UIUtils.BitmapImageFromResource("Wabbajack.Resources.Banner_Dark.png");