Fix video-plugin-metadata.result hook
We don't reload the page anymore, so we need to use onChanges instead of onInit
This commit is contained in:
parent
150d9f197d
commit
eabe08ea35
|
@ -1,10 +1,10 @@
|
|||
import { Component, Input, OnInit } from '@angular/core'
|
||||
import { DatePipe, NgFor, NgIf } from '@angular/common'
|
||||
import { Component, Input, OnChanges } from '@angular/core'
|
||||
import { RouterLink } from '@angular/router'
|
||||
import { HooksService } from '@app/core'
|
||||
import { VideoDetails } from '@app/shared/shared-main/video/video-details.model'
|
||||
import { TimeDurationFormatterPipe } from '../../../../shared/shared-main/angular/time-duration-formatter.pipe'
|
||||
import { GlobalIconComponent } from '../../../../shared/shared-icons/global-icon.component'
|
||||
import { RouterLink } from '@angular/router'
|
||||
import { NgIf, NgFor, DatePipe } from '@angular/common'
|
||||
import { TimeDurationFormatterPipe } from '../../../../shared/shared-main/angular/time-duration-formatter.pipe'
|
||||
|
||||
type PluginMetadata = {
|
||||
label: string
|
||||
|
@ -20,14 +20,14 @@ type PluginMetadata = {
|
|||
standalone: true,
|
||||
imports: [ NgIf, RouterLink, GlobalIconComponent, NgFor, DatePipe, TimeDurationFormatterPipe ]
|
||||
})
|
||||
export class VideoAttributesComponent implements OnInit {
|
||||
export class VideoAttributesComponent implements OnChanges {
|
||||
@Input() video: VideoDetails
|
||||
|
||||
pluginMetadata: PluginMetadata[] = []
|
||||
|
||||
constructor (private hooks: HooksService) { }
|
||||
|
||||
async ngOnInit () {
|
||||
async ngOnChanges () {
|
||||
this.pluginMetadata = await this.hooks.wrapObject(
|
||||
this.pluginMetadata,
|
||||
'video-watch',
|
||||
|
|
Loading…
Reference in New Issue