File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed
src/Files.App/UserControls/Widgets Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -112,7 +112,10 @@ private async Task UpdateRecentsList(NotifyCollectionChangedEventArgs e)
112
112
for ( ; idx < recentFiles . Count ; idx ++ ) // Add new items (top of the list)
113
113
{
114
114
if ( idx >= recentItemsCollection . Count || ! recentFiles [ idx ] . Equals ( recentItemsCollection [ idx ] ) )
115
- await AddItemToRecentListAsync ( recentFiles [ idx ] , idx ) ;
115
+ {
116
+ if ( ! AddItemToRecentList ( recentFiles [ idx ] , idx ) ) // Not a new item
117
+ break ;
118
+ }
116
119
else
117
120
break ;
118
121
}
@@ -147,13 +150,16 @@ private async Task UpdateRecentsList(NotifyCollectionChangedEventArgs e)
147
150
/// Add the RecentItem to the ObservableCollection for the UI to render.
148
151
/// </summary>
149
152
/// <param name="recentItem">The recent item to be added</param>
150
- private async Task AddItemToRecentListAsync ( RecentItem recentItem , int index = - 1 )
153
+ private bool AddItemToRecentList ( RecentItem recentItem , int index = - 1 )
151
154
{
152
155
if ( ! recentItemsCollection . Any ( x => x . Equals ( recentItem ) ) )
153
156
{
154
157
recentItemsCollection . Insert ( index < 0 ? recentItemsCollection . Count : Math . Min ( index , recentItemsCollection . Count ) , recentItem ) ;
155
- await recentItem . LoadRecentItemIcon ( ) ;
158
+ _ = recentItem . LoadRecentItemIcon ( )
159
+ . ContinueWith ( t => App . Logger . Warn ( t . Exception ) , TaskContinuationOptions . OnlyOnFaulted ) ;
160
+ return true ;
156
161
}
162
+ return false ;
157
163
}
158
164
159
165
private void RecentsView_ItemClick ( object sender , ItemClickEventArgs e )
You can’t perform that action at this time.
0 commit comments