Skip to content

Commit 68ab396

Browse files
Fix: Fixed bug where the wrong item was shown as active in the sidebar (#15080)
1 parent f3882fb commit 68ab396

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/Files.App/ViewModels/UserControls/SidebarViewModel.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,8 +113,7 @@ public void UpdateSidebarSelectedItemFromArgs(string? arg)
113113
}
114114

115115
item = filteredItems.FirstOrDefault(x => x.Path.Equals(value, StringComparison.OrdinalIgnoreCase));
116-
item ??= filteredItems.FirstOrDefault(x => x.Path.Equals(value + "\\", StringComparison.OrdinalIgnoreCase));
117-
item ??= filteredItems.Where(x => value.StartsWith(x.Path, StringComparison.OrdinalIgnoreCase)).MaxBy(x => x.Path.Length);
116+
item ??= filteredItems.Where(x => value.StartsWith(x.Path + "\\", StringComparison.OrdinalIgnoreCase)).MaxBy(x => x.Path.Length);
118117
item ??= filteredItems.FirstOrDefault(x => x.Path.Equals(Path.GetPathRoot(value), StringComparison.OrdinalIgnoreCase));
119118

120119
if (item is null && value == "Home")

0 commit comments

Comments
 (0)