|
|
@@ -12,6 +12,7 @@ import { Subject } from 'rxjs';
|
|
|
export class TracksPageComponent {
|
|
|
private _tracks: Track[] = [];
|
|
|
public tracks: Subject<Track[]> = new Subject<Track[]>();
|
|
|
+ public hasMore: boolean = false;
|
|
|
|
|
|
public showMyTracks: boolean = false;
|
|
|
public nameFilter: string = '';
|
|
|
@@ -40,11 +41,12 @@ export class TracksPageComponent {
|
|
|
this.tracksApi.getTracks(this.searchParams)
|
|
|
.then(trackPage => {
|
|
|
if (this.searchParams.page === 0) {
|
|
|
- this._tracks = trackPage;
|
|
|
+ this._tracks = trackPage.items;
|
|
|
} else {
|
|
|
- this._tracks.push(...trackPage);
|
|
|
+ this._tracks.push(...trackPage.items);
|
|
|
}
|
|
|
- this.tracks.next(this._tracks)
|
|
|
+ this.hasMore = trackPage.hasMore;
|
|
|
+ this.tracks.next(this._tracks);
|
|
|
});
|
|
|
}
|
|
|
}
|