Skip to content

Commit dbcb98d

Browse files
authored
Fixed an issue where the properties dialog would sometimes show the properties of the wrong directory (#2629)
1 parent ee2ae70 commit dbcb98d

File tree

1 file changed

+3
-13
lines changed

1 file changed

+3
-13
lines changed

Files/View Models/Properties/FolderProperties.cs

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -94,20 +94,10 @@ public async override void GetSpecialProperties()
9494
}
9595
}
9696

97-
var parentDirectory = AppInstance.FilesystemViewModel.CurrentFolder;
98-
99-
StorageFolder storageFolder = null;
97+
StorageFolder storageFolder;
10098
try
10199
{
102-
var isItemSelected = await CoreApplication.MainView.ExecuteOnUIThreadAsync(() => AppInstance?.ContentPage?.IsItemSelected ?? true);
103-
if (isItemSelected)
104-
{
105-
storageFolder = await AppInstance.FilesystemViewModel.GetFolderFromPathAsync((Item as ShortcutItem)?.TargetPath ?? Item.ItemPath);
106-
}
107-
else if (!parentDirectory.ItemPath.StartsWith(App.AppSettings.RecycleBinPath))
108-
{
109-
storageFolder = await AppInstance.FilesystemViewModel.GetFolderFromPathAsync(parentDirectory.ItemPath);
110-
}
100+
storageFolder = await AppInstance.FilesystemViewModel.GetFolderFromPathAsync((Item as ShortcutItem)?.TargetPath ?? Item.ItemPath);
111101
}
112102
catch (Exception ex)
113103
{
@@ -124,7 +114,7 @@ public async override void GetSpecialProperties()
124114
GetOtherProperties(storageFolder.Properties);
125115
GetFolderSize(storageFolder, TokenSource.Token);
126116
}
127-
else if (parentDirectory.ItemPath.StartsWith(App.AppSettings.RecycleBinPath))
117+
else if (Item.ItemPath.Equals(App.AppSettings.RecycleBinPath, StringComparison.OrdinalIgnoreCase))
128118
{
129119
// GetFolderFromPathAsync cannot access recyclebin folder
130120
if (AppInstance.FilesystemViewModel.Connection != null)

0 commit comments

Comments
 (0)