Skip to content

Fix: Fixed issue where the network icon was blank #10839

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 15 commits into from
Dec 26, 2022
Merged
14 changes: 6 additions & 8 deletions src/Files.App/DataModels/NavigationControlItems/DriveItem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,10 @@
using Microsoft.UI.Xaml.Media.Imaging;
using System;
using System.Threading.Tasks;
using Windows.Media.Capture;
using Windows.Storage;
using Windows.Storage.Streams;
using static Vanara.PInvoke.Shell32;

namespace Files.App.DataModels.NavigationControlItems
{
Expand Down Expand Up @@ -223,14 +225,10 @@ public async Task LoadDriveIcon()
{
if (IconData is null)
{
if (!string.IsNullOrEmpty(DeviceID))
if (!string.IsNullOrEmpty(DeviceID) && !string.Equals(DeviceID, "network-folder"))
IconData = await FileThumbnailHelper.LoadIconWithoutOverlayAsync(DeviceID, 24);

if (IconData is null)
{
var resource = UIHelpers.GetIconResourceInfo(Constants.ImageRes.Folder);
IconData = resource?.IconData;
}

IconData ??= UIHelpers.GetIconResourceInfo(Constants.ImageRes.Folder).IconData;
}
Icon = await IconData.ToBitmapAsync();
}
Expand All @@ -257,4 +255,4 @@ public enum DriveType
VirtualDrive,
CloudDrive,
}
}
}