Skip to content

Commit b866e7f

Browse files
authored
Fixed an issue where drives were not removed from sidebar when disconnected (#4192)
1 parent 50138c7 commit b866e7f

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

Files/Filesystem/Drives.cs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,15 @@ await CoreApplication.MainView.CoreWindow.Dispatcher.RunAsync(CoreDispatcherPrio
154154
}
155155
}
156156

157+
foreach (DriveItem drive in section.ChildItems.ToList())
158+
{
159+
if (!Drives.Contains(drive))
160+
{
161+
section.ChildItems.Remove(drive);
162+
DrivesWidget.ItemsAdded.Remove(drive);
163+
}
164+
}
165+
157166
MainPage.SideBarItems.EndBulkOperation();
158167
}
159168
finally

0 commit comments

Comments
 (0)