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:
Chocobozzz 2024-10-21 11:40:04 +02:00
parent 150d9f197d
commit eabe08ea35
No known key found for this signature in database
GPG Key ID: 583A612D890159BE
1 changed files with 6 additions and 6 deletions

View File

@ -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',