Skip to content

Commit 7a6e7ef

Browse files
committed
Fixed bug in IsSelected() implementation
The `IsSelected()` implementation still suffixed the `webPath` and `WebPath` with a `:`, which was needed with `UniqueKey` to ensure it wasn't a partial match against an individual key (e.g., we didn't want `Root:Web:Pro` to match `Root:Web:Products`). With `WebPath`, that shouldn't be necessary, since it always ends in `/`. That said, as web servers can be forgiving in trailing slashes, we still append a `/` at the end of `webPath` to be safe; this may result in two `//` at the end, but that won't impact the logic.
1 parent 8fd4d80 commit 7a6e7ef

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

OnTopic.ViewModels/NavigationTopicViewModel.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ public sealed record NavigationTopicViewModel : INavigationTopicViewModel<Naviga
6666
/// typically meaning the user is on the page this object is pointing to.
6767
/// </summary>
6868
public bool IsSelected(string webPath) =>
69-
$"{webPath}:".StartsWith($"{WebPath}:", StringComparison.OrdinalIgnoreCase);
69+
$"{webPath}/".StartsWith($"{WebPath}", StringComparison.OrdinalIgnoreCase);
7070

7171
} //Class
7272
} //Namespace

0 commit comments

Comments
 (0)