Fix video-abuse-list init abuse duplication
authorRigel Kent <sendmemail@rigelk.eu>
Mon, 4 May 2020 14:13:35 +0000 (16:13 +0200)
committerRigel Kent <sendmemail@rigelk.eu>
Mon, 4 May 2020 14:13:35 +0000 (16:13 +0200)
client/src/app/+admin/moderation/video-abuse-list/video-abuse-list.component.ts

index f54e3dccd4578cfb5a9f12b4c5b06228503c55ef..39f619cc35f2169950d057e809ce4e73670df490 100644 (file)
@@ -303,7 +303,7 @@ export class VideoAbuseListComponent extends RestTable implements OnInit, AfterV
     }).subscribe(
         async resultList => {
           this.totalRecords = resultList.total
-          this.videoAbuses = []
+          const videoAbuses = []
 
           for (const abuse of resultList.data) {
             Object.assign(abuse, {
@@ -316,9 +316,10 @@ export class VideoAbuseListComponent extends RestTable implements OnInit, AfterV
             if (abuse.video.channel?.ownerAccount) abuse.video.channel.ownerAccount = new Account(abuse.video.channel.ownerAccount)
             if (abuse.updatedAt === abuse.createdAt) delete abuse.updatedAt
 
-            this.videoAbuses.push(abuse as ProcessedVideoAbuse)
+            videoAbuses.push(abuse as ProcessedVideoAbuse)
           }
 
+          this.videoAbuses = videoAbuses
         },
 
         err => this.notifier.error(err.message)