]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - client/src/app/shared/video/video-edit.model.ts
Fix removing scheduled update
[github/Chocobozzz/PeerTube.git] / client / src / app / shared / video / video-edit.model.ts
index 78aed4f9f8d92523f9b9d9cd42686213233f8901..8562f8d2540d662d8ea030a6adf08a55899c6cb8 100644 (file)
@@ -55,7 +55,7 @@ export class VideoEdit implements VideoUpdate {
     })
 
     // If schedule publication, the video is private and will be changed to public privacy
-    if (values['schedulePublicationAt']) {
+    if (parseInt(values['privacy'], 10) === VideoEdit.SPECIAL_SCHEDULED_PRIVACY) {
       const updateAt = (values['schedulePublicationAt'] as Date)
       updateAt.setSeconds(0)
 
@@ -64,6 +64,8 @@ export class VideoEdit implements VideoUpdate {
         updateAt: updateAt.toISOString(),
         privacy: VideoPrivacy.PUBLIC
       }
+    } else {
+      this.scheduleUpdate = null
     }
   }