From eb7661c14a3e7078f7a43944bec316d80f016659 Mon Sep 17 00:00:00 2001 From: Isaac Abadi Date: Sat, 19 Dec 2020 02:06:52 -0500 Subject: [PATCH] Fixed bug in file deletion where file indexes became stale --- src/app/components/recent-videos/recent-videos.component.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/app/components/recent-videos/recent-videos.component.ts b/src/app/components/recent-videos/recent-videos.component.ts index e745138f..2da73f0a 100644 --- a/src/app/components/recent-videos/recent-videos.component.ts +++ b/src/app/components/recent-videos/recent-videos.component.ts @@ -250,6 +250,7 @@ export class RecentVideosComponent implements OnInit { if (result) { this.postsService.openSnackBar('Delete success!', 'OK.'); this.files.splice(file.index, 1); + for (let i = 0; i < this.files.length; i++) { this.files[i].index = i } this.filterByProperty(this.filterProperty['property']); } else { this.postsService.openSnackBar('Delete failed!', 'OK.');