From 445ac33456e5900cd49987dccc723d7ccad813f9 Mon Sep 17 00:00:00 2001 From: hishitetsu <66369541+hishitetsu@users.noreply.github.com> Date: Fri, 2 Feb 2024 01:00:56 +0900 Subject: [PATCH] Update ItemViewModel.cs --- src/Files.App/Data/Models/ItemViewModel.cs | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) 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)