]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - client/src/app/account/account-videos/account-videos.component.ts
Replace current state when changing page
[github/Chocobozzz/PeerTube.git] / client / src / app / account / account-videos / account-videos.component.ts
index cd0f8e752dd6024827e348b0c2e16373073ac19c..91bc1b695c2cbecbd31b79f829c0190f855cb6f1 100644 (file)
@@ -1,5 +1,6 @@
 import { Component, OnInit, OnDestroy } from '@angular/core'
 import { ActivatedRoute, Router } from '@angular/router'
+import { Location } from '@angular/common'
 import { immutableAssign } from '@app/shared/misc/utils'
 import { ComponentPagination } from '@app/shared/rest/component-pagination.model'
 import { NotificationsService } from 'angular2-notifications'
@@ -23,7 +24,7 @@ export class AccountVideosComponent extends AbstractVideoList implements OnInit,
   checkedVideos: { [ id: number ]: boolean } = {}
   pagination: ComponentPagination = {
     currentPage: 1,
-    itemsPerPage: 10,
+    itemsPerPage: 5,
     totalItems: null
   }
 
@@ -35,12 +36,15 @@ export class AccountVideosComponent extends AbstractVideoList implements OnInit,
                protected authService: AuthService,
                protected notificationsService: NotificationsService,
                protected confirmService: ConfirmService,
+               protected location: Location,
                private videoService: VideoService) {
     super()
   }
 
   ngOnInit () {
     super.ngOnInit()
+
+    // this.generateSyndicationList()
   }
 
   ngOnDestroy () {
@@ -61,6 +65,10 @@ export class AccountVideosComponent extends AbstractVideoList implements OnInit,
     return this.videoService.getMyVideos(newPagination, this.sort)
   }
 
+  generateSyndicationList () {
+    throw new Error('Method not implemented.')
+  }
+
   async deleteSelectedVideos () {
     const toDeleteVideosIds = Object.keys(this.checkedVideos)
       .filter(k => this.checkedVideos[k] === true)
@@ -106,6 +114,11 @@ export class AccountVideosComponent extends AbstractVideoList implements OnInit,
       )
   }
 
+  protected buildVideoHeight () {
+    // In account videos, the video height is fixed
+    return this.baseVideoHeight
+  }
+
   private spliceVideosById (id: number) {
     for (const key of Object.keys(this.loadedPages)) {
       const videos = this.loadedPages[key]