From 99113507c477ebecb7715f7ace1a5794517db4c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kham=C3=BBl?= <32278516+LordOfRhun@users.noreply.github.com> Date: Sun, 10 May 2020 13:12:43 -0400 Subject: [PATCH] Subcribe to settings SaveSignal --- Wabbajack/View Models/Gallery/ModListGalleryVM.cs | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/Wabbajack/View Models/Gallery/ModListGalleryVM.cs b/Wabbajack/View Models/Gallery/ModListGalleryVM.cs index fafac642..512661a6 100644 --- a/Wabbajack/View Models/Gallery/ModListGalleryVM.cs +++ b/Wabbajack/View Models/Gallery/ModListGalleryVM.cs @@ -73,6 +73,10 @@ namespace Wabbajack if (OnlyInstalled) GameTypeEnabled = false; Search = settings.Search; + // subscribe to save signal + MWVM.Settings.SaveSignal + .Subscribe(_ => UpdateFiltersSettings()) + .DisposeWith(this.CompositeDisposable); } else GameType = ALL_GAME_TYPE; @@ -85,7 +89,6 @@ namespace Wabbajack Search = string.Empty; GameType = ALL_GAME_TYPE; GameTypeEnabled = true; - UpdateFiltersSettings(); }); var random = new Random(); @@ -141,7 +144,6 @@ namespace Wabbajack .Filter(this.WhenAny(x => x.OnlyInstalled) .Select>(onlyInstalled => (vm) => { - UpdateFiltersSettings(); if (!onlyInstalled) return true; if (!GameRegistry.Games.TryGetValue(vm.Metadata.Game, out var gameMeta)) return false; return gameMeta.IsInstalled; @@ -152,13 +154,11 @@ namespace Wabbajack .Select>(search => (vm) => { if (string.IsNullOrWhiteSpace(search)) return true; - UpdateFiltersSettings(); return vm.Metadata.Title.ContainsCaseInsensitive(search); })) .Filter(this.WhenAny(x => x.ShowNSFW) .Select>(showNSFW => vm => { - UpdateFiltersSettings(); if (!vm.Metadata.NSFW) return true; return vm.Metadata.NSFW && showNSFW; })) @@ -172,14 +172,12 @@ namespace Wabbajack if (string.IsNullOrEmpty(GameType)) return false; - UpdateFiltersSettings(); return GameType == vm.Metadata.Game.GetDescription().ToString(); })) .Filter(this.WhenAny(x => x.ShowNSFW) .Select>(showNSFW => vm => { - UpdateFiltersSettings(); if (!vm.Metadata.NSFW) return true; return vm.Metadata.NSFW && showNSFW; }))