diff options
Diffstat (limited to 'client/src/app/+videos')
-rw-r--r-- | client/src/app/+videos/+video-edit/video-update.component.ts | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/client/src/app/+videos/+video-edit/video-update.component.ts b/client/src/app/+videos/+video-edit/video-update.component.ts index e2331c148..f27ebd20e 100644 --- a/client/src/app/+videos/+video-edit/video-update.component.ts +++ b/client/src/app/+videos/+video-edit/video-update.component.ts | |||
@@ -124,11 +124,6 @@ export class VideoUpdateComponent extends FormReactive implements OnInit { | |||
124 | 124 | ||
125 | this.video.patch(this.form.value) | 125 | this.video.patch(this.form.value) |
126 | 126 | ||
127 | const liveVideoUpdate: LiveVideoUpdate = { | ||
128 | saveReplay: this.form.value.saveReplay, | ||
129 | permanentLive: this.form.value.permanentLive | ||
130 | } | ||
131 | |||
132 | this.loadingBar.useRef().start() | 127 | this.loadingBar.useRef().start() |
133 | this.isUpdatingVideo = true | 128 | this.isUpdatingVideo = true |
134 | 129 | ||
@@ -141,6 +136,19 @@ export class VideoUpdateComponent extends FormReactive implements OnInit { | |||
141 | switchMap(() => { | 136 | switchMap(() => { |
142 | if (!this.liveVideo) return of(undefined) | 137 | if (!this.liveVideo) return of(undefined) |
143 | 138 | ||
139 | const liveVideoUpdate: LiveVideoUpdate = { | ||
140 | saveReplay: this.form.value.saveReplay, | ||
141 | permanentLive: this.form.value.permanentLive | ||
142 | } | ||
143 | |||
144 | console.log(liveVideoUpdate) | ||
145 | console.log(this.form.value) | ||
146 | |||
147 | // Don't update live attributes if they did not change | ||
148 | const liveChanged = Object.keys(liveVideoUpdate) | ||
149 | .some(key => this.liveVideo[key] !== liveVideoUpdate[key]) | ||
150 | if (!liveChanged) return of(undefined) | ||
151 | |||
144 | return this.liveVideoService.updateLive(this.video.id, liveVideoUpdate) | 152 | return this.liveVideoService.updateLive(this.video.id, liveVideoUpdate) |
145 | }) | 153 | }) |
146 | ) | 154 | ) |