From 2e257e36b78b6f6b842f5ed8b4c79514e6e3a208 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Wed, 24 Mar 2021 10:58:36 +0100 Subject: Add client action hooks for pubish pages --- .../video-add-components/video-upload.component.ts | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'client/src/app/+videos/+video-edit/video-add-components/video-upload.component.ts') diff --git a/client/src/app/+videos/+video-edit/video-add-components/video-upload.component.ts b/client/src/app/+videos/+video-edit/video-add-components/video-upload.component.ts index ca21b61cd..effb37077 100644 --- a/client/src/app/+videos/+video-edit/video-add-components/video-upload.component.ts +++ b/client/src/app/+videos/+video-edit/video-add-components/video-upload.component.ts @@ -1,15 +1,15 @@ import { Subscription } from 'rxjs' import { HttpErrorResponse, HttpEventType, HttpResponse } from '@angular/common/http' -import { Component, ElementRef, EventEmitter, OnDestroy, OnInit, Output, ViewChild } from '@angular/core' +import { AfterViewInit, Component, ElementRef, EventEmitter, OnDestroy, OnInit, Output, ViewChild } from '@angular/core' import { Router } from '@angular/router' -import { AuthService, CanComponentDeactivate, Notifier, ServerService, UserService } from '@app/core' +import { AuthService, CanComponentDeactivate, HooksService, Notifier, ServerService, UserService } from '@app/core' import { scrollToTop, uploadErrorHandler } from '@app/helpers' import { FormValidatorService } from '@app/shared/shared-forms' import { BytesPipe, VideoCaptionService, VideoEdit, VideoService } from '@app/shared/shared-main' import { LoadingBarService } from '@ngx-loading-bar/core' +import { HttpStatusCode } from '@shared/core-utils/miscs/http-error-codes' import { VideoPrivacy } from '@shared/models' import { VideoSend } from './video-send' -import { HttpStatusCode } from '@shared/core-utils/miscs/http-error-codes' @Component({ selector: 'my-video-upload', @@ -20,7 +20,7 @@ import { HttpStatusCode } from '@shared/core-utils/miscs/http-error-codes' './video-send.scss' ] }) -export class VideoUploadComponent extends VideoSend implements OnInit, OnDestroy, CanComponentDeactivate { +export class VideoUploadComponent extends VideoSend implements OnInit, AfterViewInit, OnDestroy, CanComponentDeactivate { @Output() firstStepDone = new EventEmitter() @Output() firstStepError = new EventEmitter() @ViewChild('videofileInput') videofileInput: ElementRef @@ -60,7 +60,8 @@ export class VideoUploadComponent extends VideoSend implements OnInit, OnDestroy protected videoService: VideoService, protected videoCaptionService: VideoCaptionService, private userService: UserService, - private router: Router + private router: Router, + private hooks: HooksService ) { super() } @@ -79,6 +80,10 @@ export class VideoUploadComponent extends VideoSend implements OnInit, OnDestroy }) } + ngAfterViewInit () { + this.hooks.runAction('action:video-upload.init', 'video-edit') + } + ngOnDestroy () { if (this.videoUploadObservable) this.videoUploadObservable.unsubscribe() } -- cgit v1.2.3