From ead583ac1d7a754c26defb5bb5cd565a2b52f272 Mon Sep 17 00:00:00 2001 From: Justin Swanson Date: Sun, 13 Oct 2019 03:11:31 -0500 Subject: [PATCH] OpenReadmeCommand now only executable if UIReady The function it calls shortcircuits if UIReady is false, so the command shouldn't be runnable if that's the state --- Wabbajack/AppState.cs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Wabbajack/AppState.cs b/Wabbajack/AppState.cs index dd0f5455..ff884308 100644 --- a/Wabbajack/AppState.cs +++ b/Wabbajack/AppState.cs @@ -106,8 +106,11 @@ namespace Wabbajack this.OpenModListPropertiesCommand = ReactiveCommand.Create(OpenModListProperties); this.OpenReadmeCommand = ReactiveCommand.Create( execute: this.OpenReadmeWindow, - canExecute: this.WhenAny(x => x.ModList) - .Select(modList => !string.IsNullOrEmpty(modList?.Readme)) + canExecute: Observable.CombineLatest( + this.WhenAny(x => x.ModList) + .Select(modList => !string.IsNullOrEmpty(modList?.Readme)), + this.WhenAny(x => x.UIReady), + resultSelector: (modListExists, uiReady) => modListExists && uiReady) .ObserveOnGuiThread()); this.BeginCommand = ReactiveCommand.Create( execute: this.ExecuteBegin,