@@ -293,12 +293,12 @@ public bool RestoreFromBin(Guid key, Guid? targetParentKey = null)
293
293
/// <param name="readLock">The read lock value, should be -333 or -334 for content and media trees.</param>
294
294
/// <param name="objectTypeKey">The key of the object type to rebuild.</param>
295
295
/// <param name="trashed">Indicates whether the items are in the recycle bin.</param>
296
- protected async Task HandleRebuildAsync ( int readLock , Guid objectTypeKey , bool trashed )
296
+ protected Task HandleRebuildAsync ( int readLock , Guid objectTypeKey , bool trashed )
297
297
{
298
298
// This is only relevant for items in the content and media trees
299
299
if ( readLock != Constants . Locks . ContentTree && readLock != Constants . Locks . MediaTree )
300
300
{
301
- return ;
301
+ return Task . CompletedTask ;
302
302
}
303
303
304
304
using ICoreScope scope = _coreScopeProvider . CreateCoreScope ( autoComplete : true ) ;
@@ -307,14 +307,18 @@ protected async Task HandleRebuildAsync(int readLock, Guid objectTypeKey, bool t
307
307
// Build the corresponding navigation structure
308
308
if ( trashed )
309
309
{
310
+ _recycleBinRoots . Clear ( ) ;
310
311
IEnumerable < INavigationModel > navigationModels = _navigationRepository . GetTrashedContentNodesByObjectType ( objectTypeKey ) ;
311
312
BuildNavigationDictionary ( _recycleBinNavigationStructure , _recycleBinRoots , navigationModels ) ;
312
313
}
313
314
else
314
315
{
316
+ _roots . Clear ( ) ;
315
317
IEnumerable < INavigationModel > navigationModels = _navigationRepository . GetContentNodesByObjectType ( objectTypeKey ) ;
316
318
BuildNavigationDictionary ( _navigationStructure , _roots , navigationModels ) ;
317
319
}
320
+
321
+ return Task . CompletedTask ;
318
322
}
319
323
320
324
private bool TryGetParentKeyFromStructure ( ConcurrentDictionary < Guid , NavigationNode > structure , Guid childKey , out Guid ? parentKey )
0 commit comments