Skip to content

Commit 7d11b28

Browse files
authored
Fix: Fixed issue where the network icon was blank (#10839)
1 parent 564883a commit 7d11b28

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

src/Files.App/DataModels/NavigationControlItems/DriveItem.cs

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,10 @@
99
using Microsoft.UI.Xaml.Media.Imaging;
1010
using System;
1111
using System.Threading.Tasks;
12+
using Windows.Media.Capture;
1213
using Windows.Storage;
1314
using Windows.Storage.Streams;
15+
using static Vanara.PInvoke.Shell32;
1416

1517
namespace Files.App.DataModels.NavigationControlItems
1618
{
@@ -223,14 +225,10 @@ public async Task LoadDriveIcon()
223225
{
224226
if (IconData is null)
225227
{
226-
if (!string.IsNullOrEmpty(DeviceID))
228+
if (!string.IsNullOrEmpty(DeviceID) && !string.Equals(DeviceID, "network-folder"))
227229
IconData = await FileThumbnailHelper.LoadIconWithoutOverlayAsync(DeviceID, 24);
228-
229-
if (IconData is null)
230-
{
231-
var resource = UIHelpers.GetIconResourceInfo(Constants.ImageRes.Folder);
232-
IconData = resource?.IconData;
233-
}
230+
231+
IconData ??= UIHelpers.GetIconResourceInfo(Constants.ImageRes.Folder).IconData;
234232
}
235233
Icon = await IconData.ToBitmapAsync();
236234
}
@@ -257,4 +255,4 @@ public enum DriveType
257255
VirtualDrive,
258256
CloudDrive,
259257
}
260-
}
258+
}

0 commit comments

Comments
 (0)