]> 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 78c3d91927b1dd64faf6f896cb9ae1cd9d3b1684..8d6a42dfb3429c571ac9734410623379d89155d2 100644 (file)
@@ -43,30 +43,26 @@ export class MyOwnershipComponent extends RestTable implements OnInit {
     }
   }
 
-  switchToDefaultAvatar ($event: Event) {
-    ($event.target as HTMLImageElement).src = Account.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)
+      })
   }
 }