Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions src/Files.App/Data/Models/PinnedFoldersManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,16 @@ private async Task LoadIconForLocationItemAsync(LocationItem locationItem, strin
isFolder,
IconOptions.ReturnIconOnly);

// Shell icon APIs cannot resolve icons for bare network machine roots (e.g. "\\server"); fall back to the sidebar resource icons like DriveItem does.
if (result is null)
{
var isMachineRoot = path.StartsWith(@"\\", StringComparison.Ordinal) &&
path.Split('\\', StringSplitOptions.RemoveEmptyEntries).Length == 1;
result = UIHelpers.GetSidebarIconResourceInfo(isMachineRoot
? Constants.ImageRes.Network
: Constants.ImageRes.Folder)?.IconData;
}

locationItem.IconData = result;

// Assign Icon on the UI thread: it raises PropertyChanged, which builds a XAML IconElement in a realized SidebarItem.
Expand Down