Skip to content
Snippets Groups Projects
Commit 3afa288c authored by lotte's avatar lotte
Browse files

fixed loading issue

parent 2852ef03
No related branches found
No related tags found
No related merge requests found
import { ChangeDetectionStrategy, Component, OnInit } from '@angular/core';
import { ActivatedRoute, Router } from '@angular/router';
import { BehaviorSubject, of as observableOf, Observable, Subject } from 'rxjs';
import { filter, flatMap, map, switchMap, take, tap } from 'rxjs/operators';
import { filter, flatMap, map, startWith, switchMap, take, tap } from 'rxjs/operators';
import { PaginatedSearchOptions } from '../+search-page/paginated-search-options.model';
import { SearchService } from '../+search-page/search-service/search.service';
import { SortDirection, SortOptions } from '../core/cache/models/sort-options.model';
......@@ -78,7 +78,6 @@ export class CollectionPageComponent implements OnInit {
});
this.itemRD$ = this.paginationChanges$.pipe(
tap((dto) => console.log('dto', dto)),
switchMap((dto) => this.collectionRD$.pipe(
getSucceededRemoteData(),
map((rd) => rd.payload.id),
......@@ -90,7 +89,8 @@ export class CollectionPageComponent implements OnInit {
sort: dto.sortConfig,
dsoType: DSpaceObjectType.ITEM
})).pipe(toDSpaceObjectListRD()) as Observable<RemoteData<PaginatedList<Item>>>
})
}),
startWith(undefined) // Make sure switching page shows loading component
)
)
);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment