aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/shared/video-playlist/video-add-to-playlist.component.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2019-04-05 14:16:48 +0200
committerChocobozzz <me@florianbigard.com>2019-04-05 14:16:48 +0200
commit8dfceec44a5eec8b0190d1d5076aab0f03a0cb52 (patch)
tree70ff676157240702a2013f2f6d705bfc342a8a81 /client/src/app/shared/video-playlist/video-add-to-playlist.component.ts
parent3a0fb65c61f80b510bce979a45d59d17948745e8 (diff)
downloadPeerTube-8dfceec44a5eec8b0190d1d5076aab0f03a0cb52.tar.gz
PeerTube-8dfceec44a5eec8b0190d1d5076aab0f03a0cb52.tar.zst
PeerTube-8dfceec44a5eec8b0190d1d5076aab0f03a0cb52.zip
video add to playlist component -> onpush strategy
Diffstat (limited to 'client/src/app/shared/video-playlist/video-add-to-playlist.component.ts')
-rw-r--r--client/src/app/shared/video-playlist/video-add-to-playlist.component.ts22
1 files changed, 17 insertions, 5 deletions
diff --git a/client/src/app/shared/video-playlist/video-add-to-playlist.component.ts b/client/src/app/shared/video-playlist/video-add-to-playlist.component.ts
index 152f20c85..7dcdf7a9e 100644
--- a/client/src/app/shared/video-playlist/video-add-to-playlist.component.ts
+++ b/client/src/app/shared/video-playlist/video-add-to-playlist.component.ts
@@ -1,4 +1,4 @@
1import { Component, Input, OnInit } from '@angular/core' 1import { ChangeDetectionStrategy, ChangeDetectorRef, Component, Input, OnInit } from '@angular/core'
2import { VideoPlaylistService } from '@app/shared/video-playlist/video-playlist.service' 2import { VideoPlaylistService } from '@app/shared/video-playlist/video-playlist.service'
3import { AuthService, Notifier } from '@app/core' 3import { AuthService, Notifier } from '@app/core'
4import { forkJoin } from 'rxjs' 4import { forkJoin } from 'rxjs'
@@ -19,7 +19,8 @@ type PlaylistSummary = {
19@Component({ 19@Component({
20 selector: 'my-video-add-to-playlist', 20 selector: 'my-video-add-to-playlist',
21 styleUrls: [ './video-add-to-playlist.component.scss' ], 21 styleUrls: [ './video-add-to-playlist.component.scss' ],
22 templateUrl: './video-add-to-playlist.component.html' 22 templateUrl: './video-add-to-playlist.component.html',
23 changeDetection: ChangeDetectionStrategy.OnPush
23}) 24})
24export class VideoAddToPlaylistComponent extends FormReactive implements OnInit { 25export class VideoAddToPlaylistComponent extends FormReactive implements OnInit {
25 @Input() video: Video 26 @Input() video: Video
@@ -42,7 +43,8 @@ export class VideoAddToPlaylistComponent extends FormReactive implements OnInit
42 private notifier: Notifier, 43 private notifier: Notifier,
43 private i18n: I18n, 44 private i18n: I18n,
44 private videoPlaylistService: VideoPlaylistService, 45 private videoPlaylistService: VideoPlaylistService,
45 private videoPlaylistValidatorsService: VideoPlaylistValidatorsService 46 private videoPlaylistValidatorsService: VideoPlaylistValidatorsService,
47 private cd: ChangeDetectorRef
46 ) { 48 ) {
47 super() 49 super()
48 } 50 }
@@ -79,6 +81,8 @@ export class VideoAddToPlaylistComponent extends FormReactive implements OnInit
79 stopTimestamp: existingPlaylist ? existingPlaylist.stopTimestamp : undefined 81 stopTimestamp: existingPlaylist ? existingPlaylist.stopTimestamp : undefined
80 }) 82 })
81 } 83 }
84
85 this.cd.markForCheck()
82 } 86 }
83 ) 87 )
84 } 88 }
@@ -107,6 +111,8 @@ export class VideoAddToPlaylistComponent extends FormReactive implements OnInit
107 111
108 playlist.inPlaylist = !playlist.inPlaylist 112 playlist.inPlaylist = !playlist.inPlaylist
109 this.resetOptions() 113 this.resetOptions()
114
115 this.cd.markForCheck()
110 } 116 }
111 117
112 createPlaylist () { 118 createPlaylist () {
@@ -126,6 +132,8 @@ export class VideoAddToPlaylistComponent extends FormReactive implements OnInit
126 }) 132 })
127 133
128 this.isNewPlaylistBlockOpened = false 134 this.isNewPlaylistBlockOpened = false
135
136 this.cd.markForCheck()
129 }, 137 },
130 138
131 err => this.notifier.error(err.message) 139 err => this.notifier.error(err.message)
@@ -165,7 +173,9 @@ export class VideoAddToPlaylistComponent extends FormReactive implements OnInit
165 this.notifier.error(err.message) 173 this.notifier.error(err.message)
166 174
167 playlist.inPlaylist = true 175 playlist.inPlaylist = true
168 } 176 },
177
178 () => this.cd.markForCheck()
169 ) 179 )
170 } 180 }
171 181
@@ -194,7 +204,9 @@ export class VideoAddToPlaylistComponent extends FormReactive implements OnInit
194 this.notifier.error(err.message) 204 this.notifier.error(err.message)
195 205
196 playlist.inPlaylist = false 206 playlist.inPlaylist = false
197 } 207 },
208
209 () => this.cd.markForCheck()
198 ) 210 )
199 } 211 }
200} 212}