Skip to content

Commit ec4886c

Browse files
committed
Fixed assignment of CurrentWebPath
In a previous update, we replaced `NavigationViewModel<T>`'s `CurrentKey` property with `CurrentWebPath`, in anticipation of it operating off of the URL, instead of the `UniqueKey` (8fd4d80). Unfortunately, in doing so, I missed that the _assignment_ of the `CurrentWebPath` was still pulling data from `CurrentTopic.GetUniqueKey()`—and, thus, calls to e.g. `NavigationTopicViewModel.IsSelected()` were failing, since it is now comparing against `webPath`.
1 parent cc6eb67 commit ec4886c

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

OnTopic.AspNetCore.Mvc/Components/MenuViewComponentBase{T}.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ public async Task<IViewComponentResult> InvokeAsync() {
131131
\-----------------------------------------------------------------------------------------------------------------------*/
132132
var navigationViewModel = new NavigationViewModel<T>() {
133133
NavigationRoot = await MapNavigationTopicViewModels(navigationRootTopic).ConfigureAwait(true),
134-
CurrentWebPath = CurrentTopic?.GetUniqueKey()?? HttpContext.Request.Path
134+
CurrentWebPath = CurrentTopic?.GetWebPath()?? HttpContext.Request.Path
135135
};
136136

137137
/*------------------------------------------------------------------------------------------------------------------------

OnTopic.AspNetCore.Mvc/Components/PageLevelNavigationViewComponentBase{T}.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ public async Task<IViewComponentResult> InvokeAsync() {
128128
\-----------------------------------------------------------------------------------------------------------------------*/
129129
var navigationViewModel = new NavigationViewModel<T>() {
130130
NavigationRoot = await MapNavigationTopicViewModels(navigationRootTopic).ConfigureAwait(true),
131-
CurrentWebPath = CurrentTopic?.GetUniqueKey()?? HttpContext.Request.Path
131+
CurrentWebPath = CurrentTopic?.GetWebPath()?? HttpContext.Request.Path
132132
};
133133

134134
/*------------------------------------------------------------------------------------------------------------------------

0 commit comments

Comments
 (0)