aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2023-04-14 09:57:37 +0200
committerChocobozzz <me@florianbigard.com>2023-04-14 10:14:40 +0200
commite7c89cc3f3e69776c6ad62e62a52f8d2f12a81c1 (patch)
tree88dcb15bd523af9fe42fa1fc1d380c3b8dfba089 /client/src
parent8b95440c8ac050594955926f18dab9f6d4a86e19 (diff)
downloadPeerTube-e7c89cc3f3e69776c6ad62e62a52f8d2f12a81c1.tar.gz
PeerTube-e7c89cc3f3e69776c6ad62e62a52f8d2f12a81c1.tar.zst
PeerTube-e7c89cc3f3e69776c6ad62e62a52f8d2f12a81c1.zip
Allow to update a live with untouched privacy
Diffstat (limited to 'client/src')
-rw-r--r--client/src/app/+videos/+video-edit/video-update.component.ts5
1 files changed, 3 insertions, 2 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 412b43967..b70270261 100644
--- a/client/src/app/+videos/+video-edit/video-update.component.ts
+++ b/client/src/app/+videos/+video-edit/video-update.component.ts
@@ -9,6 +9,7 @@ import { Video, VideoCaptionEdit, VideoCaptionService, VideoDetails, VideoEdit,
9import { LiveVideoService } from '@app/shared/shared-video-live' 9import { LiveVideoService } from '@app/shared/shared-video-live'
10import { LoadingBarService } from '@ngx-loading-bar/core' 10import { LoadingBarService } from '@ngx-loading-bar/core'
11import { logger } from '@root-helpers/logger' 11import { logger } from '@root-helpers/logger'
12import { pick, simpleObjectsDeepEqual } from '@shared/core-utils'
12import { LiveVideo, LiveVideoUpdate, VideoPrivacy } from '@shared/models' 13import { LiveVideo, LiveVideoUpdate, VideoPrivacy } from '@shared/models'
13import { VideoSource } from '@shared/models/videos/video-source' 14import { VideoSource } from '@shared/models/videos/video-source'
14import { hydrateFormFromVideo } from './shared/video-edit-utils' 15import { hydrateFormFromVideo } from './shared/video-edit-utils'
@@ -134,8 +135,8 @@ export class VideoUpdateComponent extends FormReactive implements OnInit {
134 } 135 }
135 136
136 // Don't update live attributes if they did not change 137 // Don't update live attributes if they did not change
137 const liveChanged = Object.keys(liveVideoUpdate) 138 const baseVideo = pick(this.liveVideo, Object.keys(liveVideoUpdate) as (keyof LiveVideoUpdate)[])
138 .some(key => this.liveVideo[key] !== liveVideoUpdate[key]) 139 const liveChanged = !simpleObjectsDeepEqual(baseVideo, liveVideoUpdate)
139 if (!liveChanged) return of(undefined) 140 if (!liveChanged) return of(undefined)
140 141
141 return this.liveVideoService.updateLive(this.videoEdit.id, liveVideoUpdate) 142 return this.liveVideoService.updateLive(this.videoEdit.id, liveVideoUpdate)