Skip to content

Commit 2f0714c

Browse files
authored
Fix: Fixed issue where some files failed to load properties (#14850)
1 parent 36642ec commit 2f0714c

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

src/Files.App/Data/Models/ItemViewModel.cs

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -974,7 +974,9 @@ await dispatcherQueue.EnqueueOrInvokeAsync(async () =>
974974
getThumbnailOnly,
975975
getIconOnly ? IconOptions.ReturnIconOnly : IconOptions.None);
976976

977-
cancellationTokenSource.Token.ThrowIfCancellationRequested();
977+
if (cancellationTokenSource.Token.IsCancellationRequested)
978+
break;
979+
978980
await Task.Delay(500);
979981
}
980982
}
@@ -1090,13 +1092,12 @@ await Task.Run(async () =>
10901092
}
10911093

10921094
cts.Token.ThrowIfCancellationRequested();
1093-
await LoadItemThumbnailAsync(item);
1095+
_ = LoadItemThumbnailAsync(item);
10941096

10951097
if (item.IsLibrary || item.PrimaryItemAttribute == StorageItemTypes.File || item.IsArchive)
10961098
{
10971099
if (!item.IsShortcut && !item.IsHiddenItem && !FtpHelpers.IsFtpPath(item.ItemPath))
10981100
{
1099-
cts.Token.ThrowIfCancellationRequested();
11001101
matchingStorageFile = await GetFileFromPathAsync(item.ItemPath, cts.Token);
11011102
if (matchingStorageFile is not null)
11021103
{
@@ -1129,7 +1130,6 @@ await dispatcherQueue.EnqueueOrInvokeAsync(() =>
11291130
{
11301131
if (!item.IsShortcut && !item.IsHiddenItem && !FtpHelpers.IsFtpPath(item.ItemPath))
11311132
{
1132-
cts.Token.ThrowIfCancellationRequested();
11331133
BaseStorageFolder matchingStorageFolder = await GetFolderFromPathAsync(item.ItemPath, cts.Token);
11341134
if (matchingStorageFolder is not null)
11351135
{
@@ -1172,10 +1172,7 @@ await dispatcherQueue.EnqueueOrInvokeAsync(() =>
11721172
}
11731173

11741174
if (loadGroupHeaderInfo && isFileTypeGroupMode)
1175-
{
1176-
cts.Token.ThrowIfCancellationRequested();
11771175
groupImage = await GetItemTypeGroupIcon(item, matchingStorageFile);
1178-
}
11791176
}
11801177
catch (Exception)
11811178
{

0 commit comments

Comments
 (0)