diff options
author | Chocobozzz <me@florianbigard.com> | 2018-02-22 15:29:32 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2018-02-22 15:29:32 +0100 |
commit | 1f30a1853e38c20a45722dbd6d38aaaec63839e8 (patch) | |
tree | cdce8cc9fcc62d9b3343c9478b1dbcefedcea972 /client/src/app/+admin/video-blacklist | |
parent | 78967fca4cacbc247fa6fb62d64b2d6825a10804 (diff) | |
download | PeerTube-1f30a1853e38c20a45722dbd6d38aaaec63839e8.tar.gz PeerTube-1f30a1853e38c20a45722dbd6d38aaaec63839e8.tar.zst PeerTube-1f30a1853e38c20a45722dbd6d38aaaec63839e8.zip |
Add confirm when admin use custom js/css
Diffstat (limited to 'client/src/app/+admin/video-blacklist')
-rw-r--r-- | client/src/app/+admin/video-blacklist/video-blacklist-list/video-blacklist-list.component.ts | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/client/src/app/+admin/video-blacklist/video-blacklist-list/video-blacklist-list.component.ts b/client/src/app/+admin/video-blacklist/video-blacklist-list/video-blacklist-list.component.ts index 56024b247..f4cf21259 100644 --- a/client/src/app/+admin/video-blacklist/video-blacklist-list/video-blacklist-list.component.ts +++ b/client/src/app/+admin/video-blacklist/video-blacklist-list/video-blacklist-list.component.ts | |||
@@ -31,22 +31,19 @@ export class VideoBlacklistListComponent extends RestTable implements OnInit { | |||
31 | this.loadData() | 31 | this.loadData() |
32 | } | 32 | } |
33 | 33 | ||
34 | removeVideoFromBlacklist (entry: BlacklistedVideo) { | 34 | async removeVideoFromBlacklist (entry: BlacklistedVideo) { |
35 | const confirmMessage = 'Do you really want to remove this video from the blacklist ? It will be available again in the video list.' | 35 | const confirmMessage = 'Do you really want to remove this video from the blacklist ? It will be available again in the video list.' |
36 | 36 | ||
37 | this.confirmService.confirm(confirmMessage, 'Remove').subscribe( | 37 | const res = await this.confirmService.confirm(confirmMessage, 'Remove') |
38 | res => { | 38 | if (res === false) return |
39 | if (res === false) return | ||
40 | 39 | ||
41 | this.videoBlacklistService.removeVideoFromBlacklist(entry.videoId).subscribe( | 40 | this.videoBlacklistService.removeVideoFromBlacklist(entry.videoId).subscribe( |
42 | status => { | 41 | () => { |
43 | this.notificationsService.success('Success', `Video ${entry.name} removed from the blacklist.`) | 42 | this.notificationsService.success('Success', `Video ${entry.name} removed from the blacklist.`) |
44 | this.loadData() | 43 | this.loadData() |
45 | }, | 44 | }, |
46 | 45 | ||
47 | err => this.notificationsService.error('Error', err.message) | 46 | err => this.notificationsService.error('Error', err.message) |
48 | ) | ||
49 | } | ||
50 | ) | 47 | ) |
51 | } | 48 | } |
52 | 49 | ||