From c1b3f2e05d11dc8b452869582dcb1b926b306d79 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Fri, 10 Mar 2023 10:34:25 +0100 Subject: Add action:video-edit.form.updated hook --- .../src/app/+videos/+video-edit/shared/video-edit.component.ts | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'client') diff --git a/client/src/app/+videos/+video-edit/shared/video-edit.component.ts b/client/src/app/+videos/+video-edit/shared/video-edit.component.ts index 13359a4d1..e3bd5fe71 100644 --- a/client/src/app/+videos/+video-edit/shared/video-edit.component.ts +++ b/client/src/app/+videos/+video-edit/shared/video-edit.component.ts @@ -240,7 +240,15 @@ export class VideoEditComponent implements OnInit, OnDestroy { this.schedulerInterval = setInterval(() => this.minScheduledDate = new Date(), 1000 * 60) // Update every minute }) - this.hooks.runAction('action:video-edit.init', 'video-edit', { type: this.type }) + const updateForm = (values: any) => { + this.form.patchValue(values) + this.cd.detectChanges() + } + this.hooks.runAction('action:video-edit.init', 'video-edit', { type: this.type, updateForm }) + + this.form.valueChanges.subscribe(() => { + this.hooks.runAction('action:video-edit.form.updated', 'video-edit', { type: this.type, formValues: this.form.value }) + }) } ngOnDestroy () { -- cgit v1.2.3