diff --git a/client/src/app/+my-account/my-account-subscriptions/my-account-subscriptions.component.html b/client/src/app/+my-account/my-account-subscriptions/my-account-subscriptions.component.html
index 4c68cd1a5..3752de49f 100644
--- a/client/src/app/+my-account/my-account-subscriptions/my-account-subscriptions.component.html
+++ b/client/src/app/+my-account/my-account-subscriptions/my-account-subscriptions.component.html
@@ -1,4 +1,4 @@
-
+
diff --git a/client/src/app/+my-account/my-account-subscriptions/my-account-subscriptions.component.ts b/client/src/app/+my-account/my-account-subscriptions/my-account-subscriptions.component.ts
index 9434b196f..9517a3705 100644
--- a/client/src/app/+my-account/my-account-subscriptions/my-account-subscriptions.component.ts
+++ b/client/src/app/+my-account/my-account-subscriptions/my-account-subscriptions.component.ts
@@ -3,6 +3,7 @@ import { NotificationsService } from 'angular2-notifications'
import { VideoChannel } from '@app/shared/video-channel/video-channel.model'
import { I18n } from '@ngx-translate/i18n-polyfill'
import { UserSubscriptionService } from '@app/shared/user-subscription'
+import { ComponentPagination } from '@app/shared/rest/component-pagination.model'
@Component({
selector: 'my-account-subscriptions',
@@ -12,6 +13,12 @@ import { UserSubscriptionService } from '@app/shared/user-subscription'
export class MyAccountSubscriptionsComponent implements OnInit {
videoChannels: VideoChannel[] = []
+ pagination: ComponentPagination = {
+ currentPage: 1,
+ itemsPerPage: 10,
+ totalItems: null
+ }
+
constructor (
private userSubscriptionService: UserSubscriptionService,
private notificationsService: NotificationsService,
@@ -19,12 +26,27 @@ export class MyAccountSubscriptionsComponent implements OnInit {
) {}
ngOnInit () {
- this.userSubscriptionService.listSubscriptions()
- .subscribe(
- res => this.videoChannels = res.data,
+ this.loadSubscriptions()
+ }
- error => this.notificationsService.error(this.i18n('Error'), error.message)
- )
+ loadSubscriptions () {
+ this.userSubscriptionService.listSubscriptions(this.pagination)
+ .subscribe(
+ res => {
+ this.videoChannels = this.videoChannels.concat(res.data)
+ this.pagination.totalItems = res.total
+ },
+
+ error => this.notificationsService.error(this.i18n('Error'), error.message)
+ )
+ }
+
+ onNearOfBottom () {
+ // Last page
+ if (this.pagination.totalItems <= (this.pagination.currentPage * this.pagination.itemsPerPage)) return
+
+ this.pagination.currentPage += 1
+ this.loadSubscriptions()
}
}
diff --git a/client/src/app/+my-account/my-account-video-imports/my-account-video-imports.component.html b/client/src/app/+my-account/my-account-video-imports/my-account-video-imports.component.html
index b2b6c3d60..329948cb5 100644
--- a/client/src/app/+my-account/my-account-video-imports/my-account-video-imports.component.html
+++ b/client/src/app/+my-account/my-account-video-imports/my-account-video-imports.component.html
@@ -29,10 +29,10 @@
- {{ videoImport.video.name }}
+ {{ videoImport.video?.name }}
|
-
- {{ videoImport.video.name }}
+ |
+ {{ videoImport.video?.name }}
|
|
@@ -40,7 +40,7 @@
{{ videoImport.createdAt }} |
-
+
|
diff --git a/client/src/app/search/search.component.html b/client/src/app/search/search.component.html
index 128cc52f5..83d014987 100644
--- a/client/src/app/search/search.component.html
+++ b/client/src/app/search/search.component.html
@@ -1,4 +1,4 @@
-