diff --git a/src/Files.App/Data/Models/ItemViewModel.cs b/src/Files.App/Data/Models/ItemViewModel.cs index c122ea796cf8..056916eedf4d 100644 --- a/src/Files.App/Data/Models/ItemViewModel.cs +++ b/src/Files.App/Data/Models/ItemViewModel.cs @@ -1063,6 +1063,9 @@ await Task.Run(async () => loadGroupHeaderInfo = gp is not null && !gp.Model.Initialized && gp.GetExtendedGroupHeaderInfo is not null; } + cts.Token.ThrowIfCancellationRequested(); + await LoadItemThumbnailAsync(item, thumbnailSize); + if (item.IsLibrary || item.PrimaryItemAttribute == StorageItemTypes.File || item.IsArchive) { if (!item.IsShortcut && !item.IsHiddenItem && !FtpHelpers.IsFtpPath(item.ItemPath)) @@ -1093,13 +1096,8 @@ await dispatcherQueue.EnqueueOrInvokeAsync(() => SetFileTag(item); wasSyncStatusLoaded = true; - - await LoadItemThumbnailAsync(item, thumbnailSize); } } - - if (!wasSyncStatusLoaded) - await LoadItemThumbnailAsync(item, thumbnailSize); } else { @@ -1109,8 +1107,6 @@ await dispatcherQueue.EnqueueOrInvokeAsync(() => BaseStorageFolder matchingStorageFolder = await GetFolderFromPathAsync(item.ItemPath, cts.Token); if (matchingStorageFolder is not null) { - cts.Token.ThrowIfCancellationRequested(); - await LoadItemThumbnailAsync(item, thumbnailSize); if (matchingStorageFolder.DisplayName != item.Name && !matchingStorageFolder.DisplayName.StartsWith("$R", StringComparison.Ordinal)) { cts.Token.ThrowIfCancellationRequested(); @@ -1147,11 +1143,6 @@ await dispatcherQueue.EnqueueOrInvokeAsync(() => wasSyncStatusLoaded = true; } } - if (!wasSyncStatusLoaded) - { - cts.Token.ThrowIfCancellationRequested(); - await LoadItemThumbnailAsync(item, thumbnailSize); - } } if (loadGroupHeaderInfo && isFileTypeGroupMode)