diff options
author | Chocobozzz <me@florianbigard.com> | 2021-12-29 15:33:24 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2022-01-03 14:20:52 +0100 |
commit | cc4bf76c13e38e9065d49161b6e0485657424577 (patch) | |
tree | d7ecc6bd58037c41587eb911776b676592985cd1 /client/src/app/+videos/+video-edit/video-update.component.ts | |
parent | e2aeb8ad0f3055d54ac416ec5908d26b70aac4be (diff) | |
download | PeerTube-cc4bf76c13e38e9065d49161b6e0485657424577.tar.gz PeerTube-cc4bf76c13e38e9065d49161b6e0485657424577.tar.zst PeerTube-cc4bf76c13e38e9065d49161b6e0485657424577.zip |
Handle async validators
Diffstat (limited to 'client/src/app/+videos/+video-edit/video-update.component.ts')
-rw-r--r-- | client/src/app/+videos/+video-edit/video-update.component.ts | 13 |
1 files changed, 5 insertions, 8 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 e44aea10a..5e4955f6a 100644 --- a/client/src/app/+videos/+video-edit/video-update.component.ts +++ b/client/src/app/+videos/+video-edit/video-update.component.ts | |||
@@ -91,12 +91,6 @@ export class VideoUpdateComponent extends FormReactive implements OnInit { | |||
91 | return { canDeactivate: this.formChanged === false, text } | 91 | return { canDeactivate: this.formChanged === false, text } |
92 | } | 92 | } |
93 | 93 | ||
94 | checkForm () { | ||
95 | this.forceCheck() | ||
96 | |||
97 | return this.form.valid | ||
98 | } | ||
99 | |||
100 | isWaitTranscodingEnabled () { | 94 | isWaitTranscodingEnabled () { |
101 | if (this.videoDetails.getFiles().length > 1) { // Already transcoded | 95 | if (this.videoDetails.getFiles().length > 1) { // Already transcoded |
102 | return false | 96 | return false |
@@ -109,8 +103,11 @@ export class VideoUpdateComponent extends FormReactive implements OnInit { | |||
109 | return true | 103 | return true |
110 | } | 104 | } |
111 | 105 | ||
112 | update () { | 106 | async update () { |
113 | if (this.checkForm() === false || this.isUpdatingVideo === true) { | 107 | await this.waitPendingCheck() |
108 | this.forceCheck() | ||
109 | |||
110 | if (!this.form.valid || this.isUpdatingVideo === true) { | ||
114 | return | 111 | return |
115 | } | 112 | } |
116 | 113 | ||