X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=client%2Fsrc%2Fapp%2Fshared%2Fshared-custom-markup%2Fpeertube-custom-tags%2Fvideos-list-markup.component.ts;h=7c2e7db6a1bbc5fc7668074d9c2a4087a67131ab;hb=a2be43f5700460d3afdc194abc788690b79e66cd;hp=7d3498d4cb7a33bbddddc988ff21d3b57e32aa10;hpb=a2fb5fb8b1007e3ce82e707917f5d9a37374e99b;p=github%2FChocobozzz%2FPeerTube.git diff --git a/client/src/app/shared/shared-custom-markup/peertube-custom-tags/videos-list-markup.component.ts b/client/src/app/shared/shared-custom-markup/peertube-custom-tags/videos-list-markup.component.ts index 7d3498d4c..7c2e7db6a 100644 --- a/client/src/app/shared/shared-custom-markup/peertube-custom-tags/videos-list-markup.component.ts +++ b/client/src/app/shared/shared-custom-markup/peertube-custom-tags/videos-list-markup.component.ts @@ -1,5 +1,5 @@ import { finalize } from 'rxjs/operators' -import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core' +import { ChangeDetectionStrategy, ChangeDetectorRef, Component, EventEmitter, Input, OnInit, Output } from '@angular/core' import { AuthService, Notifier } from '@app/core' import { VideoSortField } from '@shared/models' import { Video, VideoService } from '../../shared-main' @@ -13,7 +13,8 @@ import { CustomMarkupComponent } from './shared' @Component({ selector: 'my-videos-list-markup', templateUrl: 'videos-list-markup.component.html', - styleUrls: [ 'videos-list-markup.component.scss' ] + styleUrls: [ 'videos-list-markup.component.scss' ], + changeDetection: ChangeDetectionStrategy.OnPush }) export class VideosListMarkupComponent implements CustomMarkupComponent, OnInit { @Input() sort: string @@ -45,7 +46,8 @@ export class VideosListMarkupComponent implements CustomMarkupComponent, OnInit constructor ( private auth: AuthService, private videoService: VideoService, - private notifier: Notifier + private notifier: Notifier, + private cd: ChangeDetectorRef ) { } getUser () { @@ -72,7 +74,10 @@ export class VideosListMarkupComponent implements CustomMarkupComponent, OnInit return this.getVideosObservable() .pipe(finalize(() => this.loaded.emit(true))) .subscribe({ - next: ({ data }) => this.videos = data, + next: ({ data }) => { + this.videos = data + this.cd.markForCheck() + }, error: err => this.notifier.error($localize`Error in videos list component: ${err.message}`) })