X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=client%2Fsrc%2Fapp%2F%2Bvideos%2Fvideo-list%2Fvideo-local.component.ts;h=af7eecff4476277d802d562914e0d50d63eac94d;hb=5bcbcbe338ef5a1ed14f084311d013fbb25dabcf;hp=b4c71ac4984e99954fe735b73cceaeb6521f6ea2;hpb=1942f11d5ee6926ad93dc1b79fae18325ba5de18;p=github%2FChocobozzz%2FPeerTube.git diff --git a/client/src/app/+videos/video-list/video-local.component.ts b/client/src/app/+videos/video-list/video-local.component.ts index b4c71ac49..af7eecff4 100644 --- a/client/src/app/+videos/video-list/video-local.component.ts +++ b/client/src/app/+videos/video-list/video-local.component.ts @@ -1,11 +1,10 @@ -import { Component, OnDestroy, OnInit } from '@angular/core' +import { Component, ComponentFactoryResolver, OnDestroy, OnInit } from '@angular/core' import { ActivatedRoute, Router } from '@angular/router' import { AuthService, LocalStorageService, Notifier, ScreenService, ServerService, UserService } from '@app/core' import { HooksService } from '@app/core/plugins/hooks.service' import { immutableAssign } from '@app/helpers' import { VideoService } from '@app/shared/shared-main' import { AbstractVideoList } from '@app/shared/shared-video-miniature' -import { I18n } from '@ngx-translate/i18n-polyfill' import { UserRight, VideoFilter, VideoSortField } from '@shared/models' @Component({ @@ -21,7 +20,6 @@ export class VideoLocalComponent extends AbstractVideoList implements OnInit, On useUserVideoPreferences = true constructor ( - protected i18n: I18n, protected router: Router, protected serverService: ServerService, protected route: ActivatedRoute, @@ -30,22 +28,19 @@ export class VideoLocalComponent extends AbstractVideoList implements OnInit, On protected userService: UserService, protected screenService: ScreenService, protected storageService: LocalStorageService, + protected cfr: ComponentFactoryResolver, private videoService: VideoService, private hooks: HooksService ) { super() - this.titlePage = i18n('Local videos') + this.titlePage = $localize`Local videos` } ngOnInit () { super.ngOnInit() - if (this.authService.isLoggedIn()) { - const user = this.authService.getUser() - this.displayModerationBlock = user.hasRight(UserRight.SEE_ALL_VIDEOS) - } - + this.enableAllFilterIfPossible() this.generateSyndicationList() } @@ -79,7 +74,7 @@ export class VideoLocalComponent extends AbstractVideoList implements OnInit, On } toggleModerationDisplay () { - this.filter = this.filter === 'local' ? 'all-local' as 'all-local' : 'local' as 'local' + this.filter = this.buildLocalFilter(this.filter, 'local') this.reloadVideos() }