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 { HooksService } from '@app/core'
|
||||||
import { VideoDetails } from '@app/shared/shared-main/video/video-details.model'
|
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 { GlobalIconComponent } from '../../../../shared/shared-icons/global-icon.component'
|
||||||
import { RouterLink } from '@angular/router'
|
import { TimeDurationFormatterPipe } from '../../../../shared/shared-main/angular/time-duration-formatter.pipe'
|
||||||
import { NgIf, NgFor, DatePipe } from '@angular/common'
|
|
||||||
|
|
||||||
type PluginMetadata = {
|
type PluginMetadata = {
|
||||||
label: string
|
label: string
|
||||||
|
@ -20,14 +20,14 @@ type PluginMetadata = {
|
||||||
standalone: true,
|
standalone: true,
|
||||||
imports: [ NgIf, RouterLink, GlobalIconComponent, NgFor, DatePipe, TimeDurationFormatterPipe ]
|
imports: [ NgIf, RouterLink, GlobalIconComponent, NgFor, DatePipe, TimeDurationFormatterPipe ]
|
||||||
})
|
})
|
||||||
export class VideoAttributesComponent implements OnInit {
|
export class VideoAttributesComponent implements OnChanges {
|
||||||
@Input() video: VideoDetails
|
@Input() video: VideoDetails
|
||||||
|
|
||||||
pluginMetadata: PluginMetadata[] = []
|
pluginMetadata: PluginMetadata[] = []
|
||||||
|
|
||||||
constructor (private hooks: HooksService) { }
|
constructor (private hooks: HooksService) { }
|
||||||
|
|
||||||
async ngOnInit () {
|
async ngOnChanges () {
|
||||||
this.pluginMetadata = await this.hooks.wrapObject(
|
this.pluginMetadata = await this.hooks.wrapObject(
|
||||||
this.pluginMetadata,
|
this.pluginMetadata,
|
||||||
'video-watch',
|
'video-watch',
|
||||||
|
|
Loading…
Reference in New Issue