From cc4bf76c13e38e9065d49161b6e0485657424577 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Wed, 29 Dec 2021 15:33:24 +0100 Subject: Handle async validators --- .../src/app/+videos/+video-edit/video-update.component.ts | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) (limited to 'client/src/app/+videos/+video-edit/video-update.component.ts') 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 { return { canDeactivate: this.formChanged === false, text } } - checkForm () { - this.forceCheck() - - return this.form.valid - } - isWaitTranscodingEnabled () { if (this.videoDetails.getFiles().length > 1) { // Already transcoded return false @@ -109,8 +103,11 @@ export class VideoUpdateComponent extends FormReactive implements OnInit { return true } - update () { - if (this.checkForm() === false || this.isUpdatingVideo === true) { + async update () { + await this.waitPendingCheck() + this.forceCheck() + + if (!this.form.valid || this.isUpdatingVideo === true) { return } -- cgit v1.2.3