Skip to content

Commit 191d729

Browse files
authoredJan 27, 2025··
Merge pull request #2538 from Nexus-Mods/fix/applychanges-exception
Fix `ApplyChanges` exceptions in the library/loadout
2 parents c429109 + 95e6420 commit 191d729

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed
 

‎src/NexusMods.App.UI/Controls/TreeDataGrid/TreeDataGridAdapter.cs

+3-2
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
using NexusMods.App.UI.Extensions;
88
using ObservableCollections;
99
using R3;
10+
using System.Reactive.Linq;
1011

1112
namespace NexusMods.App.UI.Controls;
1213

@@ -99,9 +100,9 @@ protected TreeDataGridAdapter()
99100
return self
100101
.GetRootsObservable(viewHierarchical)
101102
.OnUI()
103+
.Do(changeSet => self.Roots.ApplyChanges(changeSet))
102104
.DisposeMany()
103105
.ToObservable()
104-
.Do(self, static (changeSet, self) => self.Roots.ApplyChanges(changeSet))
105106
.Select(viewHierarchical, static (_, viewHierarchical) => viewHierarchical);
106107
})
107108
.Switch()
@@ -119,7 +120,7 @@ private static (ITreeDataGridSelection, Observable<TreeSelectionModelSelectionCh
119120
SingleSelect = false,
120121
};
121122

122-
var selectionObservable = Observable.FromEventHandler<TreeSelectionModelSelectionChangedEventArgs<TModel>>(
123+
var selectionObservable = R3.Observable.FromEventHandler<TreeSelectionModelSelectionChangedEventArgs<TModel>>(
123124
addHandler: handler => selection.SelectionChanged += handler,
124125
removeHandler: handler => selection.SelectionChanged -= handler
125126
).Select(tuple => tuple.e);

‎src/NexusMods.App.UI/Pages/LibraryPage/NexusModsModPageLibraryItemModel.cs

+2-1
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,8 @@ public NexusModsModPageLibraryItemModel(IObservable<IChangeSet<NexusModsLibraryI
120120
FormattedInstalledDate,
121121
InstallItemCommand,
122122
IsInstalled,
123-
InstallButtonText
123+
InstallButtonText,
124+
linkedLoadoutItemsDisposable
124125
);
125126
}
126127

0 commit comments

Comments
 (0)
Please sign in to comment.