Skip to content

Commit 2c51c8f

Browse files
committed
Ensure Recent Item List empty text always displays when empty
1 parent 42d3c3e commit 2c51c8f

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

Files/UserControls/YourHome.xaml.cs

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -268,14 +268,25 @@ public async void PopulateRecentsList()
268268
Visibility ItemFolderImgVis;
269269
Visibility ItemEmptyImgVis;
270270
Visibility ItemFileIconVis;
271-
if (mostRecentlyUsed.Entries.Count == 0)
271+
bool IsRecentsListEmpty = true;
272+
foreach(var entry in mostRecentlyUsed.Entries)
273+
{
274+
var item = await mostRecentlyUsed.GetItemAsync(entry.Token);
275+
if (item.IsOfType(StorageItemTypes.File))
276+
{
277+
IsRecentsListEmpty = false;
278+
}
279+
}
280+
281+
if (IsRecentsListEmpty)
272282
{
273283
Empty.Visibility = Visibility.Visible;
274284
}
275285
else
276286
{
277287
Empty.Visibility = Visibility.Collapsed;
278288
}
289+
279290
foreach (Windows.Storage.AccessCache.AccessListEntry entry in mostRecentlyUsed.Entries)
280291
{
281292
string mruToken = entry.Token;
@@ -313,6 +324,11 @@ public async void PopulateRecentsList()
313324
// Skip item until consent is provided
314325
}
315326
}
327+
328+
if(recentItemsCollection.Count == 0)
329+
{
330+
Empty.Visibility = Visibility.Visible;
331+
}
316332
}
317333

318334
private async void RecentsView_ItemClick(object sender, ItemClickEventArgs e)

0 commit comments

Comments
 (0)