]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - client/src/app/+my-library/my-ownership/my-ownership.component.ts
Prevent invalid end watch section warnings
[github/Chocobozzz/PeerTube.git] / client / src / app / +my-library / my-ownership / my-ownership.component.ts
index e1aca65f6701d6926a407b1a9033238eefafba3c..8d6a42dfb3429c571ac9734410623379d89155d2 100644 (file)
@@ -1,7 +1,7 @@
 import { SortMeta } from 'primeng/api'
 import { Component, OnInit, ViewChild } from '@angular/core'
 import { Notifier, RestPagination, RestTable } from '@app/core'
-import { Account, Actor, VideoOwnershipService } from '@app/shared/shared-main'
+import { Account, VideoOwnershipService } from '@app/shared/shared-main'
 import { VideoChangeOwnership, VideoChangeOwnershipStatus } from '@shared/models'
 import { MyAcceptOwnershipComponent } from './my-accept-ownership/my-accept-ownership.component'
 
@@ -43,30 +43,26 @@ export class MyOwnershipComponent extends RestTable implements OnInit {
     }
   }
 
-  switchToDefaultAvatar ($event: Event) {
-    ($event.target as HTMLImageElement).src = Actor.GET_DEFAULT_AVATAR_URL()
-  }
-
   openAcceptModal (videoChangeOwnership: VideoChangeOwnership) {
     this.myAccountAcceptOwnershipComponent.show(videoChangeOwnership)
   }
 
   accepted () {
-    this.loadData()
+    this.reloadData()
   }
 
   refuse (videoChangeOwnership: VideoChangeOwnership) {
     this.videoOwnershipService.refuseOwnership(videoChangeOwnership.id)
-      .subscribe(
-        () => this.loadData(),
-        err => this.notifier.error(err.message)
-      )
+      .subscribe({
+        next: () => this.reloadData(),
+        error: err => this.notifier.error(err.message)
+      })
   }
 
-  protected loadData () {
+  protected reloadDataInternal () {
     return this.videoOwnershipService.getOwnershipChanges(this.pagination, this.sort)
-      .subscribe(
-        resultList => {
+      .subscribe({
+        next: resultList => {
           this.videoChangeOwnerships = resultList.data.map(change => ({
             ...change,
             initiatorAccount: new Account(change.initiatorAccount),
@@ -75,7 +71,7 @@ export class MyOwnershipComponent extends RestTable implements OnInit {
           this.totalRecords = resultList.total
         },
 
-        err => this.notifier.error(err.message)
-      )
+        error: err => this.notifier.error(err.message)
+      })
   }
 }