Skip to content

Commit 409f5b4

Browse files
authored
Fixed an issue where the eject drive option would sometimes show for pinned folders (#2382)
1 parent 997b158 commit 409f5b4

File tree

1 file changed

+16
-25
lines changed

1 file changed

+16
-25
lines changed

Files/UserControls/SidebarControl.xaml.cs

Lines changed: 16 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -202,36 +202,27 @@ private void NavigationViewLocationItem_RightTapped(object sender, RightTappedRo
202202
Microsoft.UI.Xaml.Controls.NavigationViewItem sidebarItem = (Microsoft.UI.Xaml.Controls.NavigationViewItem)sender;
203203
var item = sidebarItem.DataContext as LocationItem;
204204

205-
if (item.IsDefaultLocation)
206-
{
207-
ShowUnpinItem = false;
208-
}
209-
else
210-
{
211-
ShowUnpinItem = true;
212-
}
213-
214-
if (item.Path.Equals(App.AppSettings.RecycleBinPath, StringComparison.OrdinalIgnoreCase))
215-
{
216-
RecycleBinItemRightTapped?.Invoke(this, EventArgs.Empty);
217-
218-
ShowEmptyRecycleBin = true;
219-
ShowUnpinItem = true;
220-
ShowProperties = false;
221-
}
222-
else
223-
{
224-
ShowEmptyRecycleBin = false;
225-
// Set to true if properties should be displayed for pinned folders
226-
ShowProperties = false;
227-
}
205+
ShowEmptyRecycleBin = false;
206+
ShowUnpinItem = true;
207+
ShowProperties = true;
208+
ShowEjectDevice = false;
228209

229-
// Additional check needed because ShowProperties is set to true if not recycle bin
230210
if (item.IsDefaultLocation)
231211
{
232212
ShowProperties = false;
233-
}
234213

214+
if (item.Path.Equals(App.AppSettings.RecycleBinPath, StringComparison.OrdinalIgnoreCase))
215+
{
216+
RecycleBinItemRightTapped?.Invoke(this, EventArgs.Empty);
217+
218+
ShowEmptyRecycleBin = true;
219+
}
220+
else
221+
{
222+
ShowUnpinItem = false;
223+
}
224+
}
225+
235226
SideBarItemContextFlyout.ShowAt(sidebarItem, e.GetPosition(sidebarItem));
236227
App.RightClickedItem = item;
237228
}

0 commit comments

Comments
 (0)