FilePickerVM optimization for initial values

Was debouncing off its initial value of null, so any initial value set by settings wouldn't take immediate effect until later.
This commit is contained in:
Justin Swanson 2019-11-14 22:55:27 -06:00
parent f8366c838a
commit fd94df0f10

View File

@ -77,7 +77,9 @@ namespace Wabbajack
this.WhenAny(x => x.DoExistsCheck),
this.WhenAny(x => x.PathType),
this.WhenAny(x => x.TargetPath)
.Throttle(TimeSpan.FromMilliseconds(200)),
// Dont want to debounce the initial value, because we know it's null
.Skip(1)
.Debounce(TimeSpan.FromMilliseconds(200)),
resultSelector: (_, DoExists, Type, Path) => (DoExists, Type, Path))
// Refresh exists
.Select(t =>
@ -95,6 +97,7 @@ namespace Wabbajack
return true;
}
})
.StartWith(false)
.DistinctUntilChanged()
.ObserveOn(RxApp.MainThreadScheduler)
.ToProperty(this, nameof(this.Exists));