Skip to content

Commit 2dcd11a

Browse files
committed
Prevent twice entrance
1 parent e579722 commit 2dcd11a

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

Files/ViewModels/ItemViewModel.cs

+7-2
Original file line numberDiff line numberDiff line change
@@ -906,7 +906,11 @@ public async Task LoadExtendedItemProperties(ListedItem item, uint thumbnailSize
906906
return;
907907
}
908908

909-
item.ItemPropertiesInitialized = true;
909+
if (itemLoadQueue.ContainsKey(item.ItemPath))
910+
{
911+
return;
912+
}
913+
910914
itemLoadQueue[item.ItemPath] = false;
911915

912916
var cts = loadPropsCTS;
@@ -916,6 +920,7 @@ public async Task LoadExtendedItemProperties(ListedItem item, uint thumbnailSize
916920
await Task.Run(async () =>
917921
{
918922
await itemLoadEvent.WaitAsync(cts.Token);
923+
item.ItemPropertiesInitialized = true;
919924

920925
if (itemLoadQueue.TryGetValue(item.ItemPath, out var canceled) && canceled)
921926
{
@@ -1045,7 +1050,7 @@ await FilesystemTasks.Wrap(() => CoreApplication.MainView.DispatcherQueue.Enqueu
10451050
}
10461051
catch (OperationCanceledException)
10471052
{
1048-
item.ItemPropertiesInitialized = false;
1053+
// ignored
10491054
}
10501055
finally
10511056
{

0 commit comments

Comments
 (0)