Skip to content

Commit 4c3faf0

Browse files
committed
Fixed partial match bug in IsSelected
Previously, `IsSelected()` would mark `/Web/Cat` as being selected if the user was on `/Web/Catacomb` because it relied on a `StartsWith()` query against `UniqueKey`. Fixed this by appending `:` to both the source and the target to ensure that the last `Key` in the `UniqueKey` was a full match, not a partial match.
1 parent 66774f7 commit 4c3faf0

3 files changed

Lines changed: 5 additions & 5 deletions

File tree

Ignia.Topics.Tests/Properties/AssemblyInfo.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
[assembly: AssemblyTrademark("")]
2222
[assembly: AssemblyCulture("")]
2323
[assembly: ComVisible(false)]
24-
[assembly: AssemblyVersion("3.5.1739.0")]
25-
[assembly: AssemblyFileVersion("3.5.1787.0")]
24+
[assembly: AssemblyVersion("3.5.1743.0")]
25+
[assembly: AssemblyFileVersion("3.5.1791.0")]
2626
[assembly: CLSCompliant(true)]
2727
[assembly: Guid("27632801-bfe3-41d9-8678-3c4bbe45e6c9")]

Ignia.Topics.ViewModels/NavigationTopicViewModel.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public sealed class NavigationTopicViewModel : TopicViewModel, INavigationTopicV
3131
public string WebPath { get; set; }
3232
public string ShortTitle { get; set; }
3333
public Collection<NavigationTopicViewModel> Children { get; set; }
34-
public bool IsSelected(string uniqueKey) => uniqueKey?.StartsWith(UniqueKey) ?? false;
34+
public bool IsSelected(string uniqueKey) => $"{uniqueKey}:"?.StartsWith($"{UniqueKey}:") ?? false;
3535

3636
} // Class
3737

Ignia.Topics.ViewModels/Properties/AssemblyInfo.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@
2121
[assembly: AssemblyTrademark("")]
2222
[assembly: AssemblyCulture("")]
2323
[assembly: ComVisible(false)]
24-
[assembly: AssemblyVersion("3.5.1739.0")]
25-
[assembly: AssemblyFileVersion("3.5.1770.0")]
24+
[assembly: AssemblyVersion("3.5.1741.0")]
25+
[assembly: AssemblyFileVersion("3.5.1772.0")]
2626
[assembly: CLSCompliant(true)]
2727
[assembly: Guid("e52fc633-b4c5-4a2b-8caf-30e756d7a6a7")]
2828

0 commit comments

Comments
 (0)