diff options
author | Chocobozzz <me@florianbigard.com> | 2022-11-15 15:16:41 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2022-11-15 15:16:41 +0100 |
commit | 7dcd7d81406f4869363d2a5595d5c68f7106eb22 (patch) | |
tree | 6da3b6fa6c58db11187cde99b66756ef621360b7 /client/src/app | |
parent | 99b757488c077cee7d0ab89eeec181a7ee6290eb (diff) | |
download | PeerTube-7dcd7d81406f4869363d2a5595d5c68f7106eb22.tar.gz PeerTube-7dcd7d81406f4869363d2a5595d5c68f7106eb22.tar.zst PeerTube-7dcd7d81406f4869363d2a5595d5c68f7106eb22.zip |
Fix client lint
Diffstat (limited to 'client/src/app')
6 files changed, 8 insertions, 8 deletions
diff --git a/client/src/app/+videos/+video-edit/video-add.component.ts b/client/src/app/+videos/+video-edit/video-add.component.ts index 25203de1b..460c37a38 100644 --- a/client/src/app/+videos/+video-edit/video-add.component.ts +++ b/client/src/app/+videos/+video-edit/video-add.component.ts | |||
@@ -143,7 +143,7 @@ export class VideoAddComponent implements OnInit, CanComponentDeactivate { | |||
143 | return text | 143 | return text |
144 | } | 144 | } |
145 | 145 | ||
146 | canDeactivate (): { canDeactivate: boolean, text?: string} { | 146 | canDeactivate (): { canDeactivate: boolean, text?: string } { |
147 | if (this.secondStepType === 'upload') return this.videoUpload.canDeactivate() | 147 | if (this.secondStepType === 'upload') return this.videoUpload.canDeactivate() |
148 | if (this.secondStepType === 'import-url') return this.videoImportUrl.canDeactivate() | 148 | if (this.secondStepType === 'import-url') return this.videoImportUrl.canDeactivate() |
149 | if (this.secondStepType === 'import-torrent') return this.videoImportTorrent.canDeactivate() | 149 | if (this.secondStepType === 'import-torrent') return this.videoImportTorrent.canDeactivate() |
diff --git a/client/src/app/core/routing/preload-selected-modules-list.ts b/client/src/app/core/routing/preload-selected-modules-list.ts index b5c3195b0..1abcdb015 100644 --- a/client/src/app/core/routing/preload-selected-modules-list.ts +++ b/client/src/app/core/routing/preload-selected-modules-list.ts | |||
@@ -1,13 +1,13 @@ | |||
1 | import { Observable, of as ofObservable, timer as observableTimer } from 'rxjs' | 1 | import { Observable, of as ofObservable, timer as observableTimer } from 'rxjs' |
2 | import { switchMap } from 'rxjs/operators' | 2 | import { switchMap } from 'rxjs/operators' |
3 | import { PreloadingStrategy, Route } from '@angular/router' | ||
4 | import { Injectable } from '@angular/core' | 3 | import { Injectable } from '@angular/core' |
4 | import { PreloadingStrategy, Route } from '@angular/router' | ||
5 | 5 | ||
6 | @Injectable() | 6 | @Injectable() |
7 | export class PreloadSelectedModulesList implements PreloadingStrategy { | 7 | export class PreloadSelectedModulesList implements PreloadingStrategy { |
8 | 8 | ||
9 | preload (route: Route, load: () => Observable<any>): Observable<any> { | 9 | preload (route: Route, load: () => Observable<any>): Observable<any> { |
10 | if (!route.data || !route.data.preload) return ofObservable(null) | 10 | if (!route.data?.preload) return ofObservable(null) |
11 | 11 | ||
12 | if (typeof route.data.preload === 'number') { | 12 | if (typeof route.data.preload === 'number') { |
13 | return observableTimer(route.data.preload).pipe(switchMap(() => load())) | 13 | return observableTimer(route.data.preload).pipe(switchMap(() => load())) |
diff --git a/client/src/app/shared/shared-main/angular/number-formatter.pipe.ts b/client/src/app/shared/shared-main/angular/number-formatter.pipe.ts index 7c18b7f67..e0cb475fc 100644 --- a/client/src/app/shared/shared-main/angular/number-formatter.pipe.ts +++ b/client/src/app/shared/shared-main/angular/number-formatter.pipe.ts | |||
@@ -13,11 +13,11 @@ export class NumberFormatterPipe implements PipeTransform { | |||
13 | static getDecimalForNumber (x: number, n = 1) { | 13 | static getDecimalForNumber (x: number, n = 1) { |
14 | const v = x.toString().split('.') | 14 | const v = x.toString().split('.') |
15 | const f = v[1] || '' | 15 | const f = v[1] || '' |
16 | if (f.length > n) return +f.substr(0, n) | 16 | if (f.length > n) return +f.substring(0, n) |
17 | return +f | 17 | return +f |
18 | } | 18 | } |
19 | 19 | ||
20 | private dictionary: Array<{max: number, type: string}> = [ | 20 | private dictionary: Array<{ max: number, type: string }> = [ |
21 | { max: 1000, type: '' }, | 21 | { max: 1000, type: '' }, |
22 | { max: 1000000, type: 'K' }, | 22 | { max: 1000000, type: 'K' }, |
23 | { max: 1000000000, type: 'M' } | 23 | { max: 1000000000, type: 'M' } |
diff --git a/client/src/app/shared/shared-main/misc/list-overflow.component.ts b/client/src/app/shared/shared-main/misc/list-overflow.component.ts index 7e4e1b1d1..b6ce21641 100644 --- a/client/src/app/shared/shared-main/misc/list-overflow.component.ts +++ b/client/src/app/shared/shared-main/misc/list-overflow.component.ts | |||
@@ -32,7 +32,7 @@ export interface ListOverflowItem { | |||
32 | }) | 32 | }) |
33 | export class ListOverflowComponent<T extends ListOverflowItem> implements AfterViewInit { | 33 | export class ListOverflowComponent<T extends ListOverflowItem> implements AfterViewInit { |
34 | @Input() items: T[] | 34 | @Input() items: T[] |
35 | @Input() itemTemplate: TemplateRef<{item: T}> | 35 | @Input() itemTemplate: TemplateRef<{ item: T }> |
36 | 36 | ||
37 | @ViewChild('modal', { static: true }) modal: ElementRef | 37 | @ViewChild('modal', { static: true }) modal: ElementRef |
38 | @ViewChild('itemsParent', { static: true }) parent: ElementRef<HTMLDivElement> | 38 | @ViewChild('itemsParent', { static: true }) parent: ElementRef<HTMLDivElement> |
diff --git a/client/src/app/shared/shared-video-miniature/video-download.component.ts b/client/src/app/shared/shared-video-miniature/video-download.component.ts index 667cb107f..4135542dc 100644 --- a/client/src/app/shared/shared-video-miniature/video-download.component.ts +++ b/client/src/app/shared/shared-video-miniature/video-download.component.ts | |||
@@ -10,7 +10,7 @@ import { VideoCaption, VideoFile, VideoPrivacy } from '@shared/models' | |||
10 | import { BytesPipe, NumberFormatterPipe, VideoDetails, VideoFileTokenService, VideoService } from '../shared-main' | 10 | import { BytesPipe, NumberFormatterPipe, VideoDetails, VideoFileTokenService, VideoService } from '../shared-main' |
11 | 11 | ||
12 | type DownloadType = 'video' | 'subtitles' | 12 | type DownloadType = 'video' | 'subtitles' |
13 | type FileMetadata = { [key: string]: { label: string, value: string }} | 13 | type FileMetadata = { [key: string]: { label: string, value: string } } |
14 | 14 | ||
15 | @Component({ | 15 | @Component({ |
16 | selector: 'my-video-download', | 16 | selector: 'my-video-download', |
diff --git a/client/src/app/shared/shared-video-playlist/video-playlist-element-miniature.component.ts b/client/src/app/shared/shared-video-playlist/video-playlist-element-miniature.component.ts index 7a2574345..79b7b9a50 100644 --- a/client/src/app/shared/shared-video-playlist/video-playlist-element-miniature.component.ts +++ b/client/src/app/shared/shared-video-playlist/video-playlist-element-miniature.component.ts | |||
@@ -74,7 +74,7 @@ export class VideoPlaylistElementMiniatureComponent implements OnInit { | |||
74 | } | 74 | } |
75 | 75 | ||
76 | buildRouterQuery () { | 76 | buildRouterQuery () { |
77 | if (!this.playlistElement || !this.playlistElement.video) return {} | 77 | if (!this.playlistElement?.video) return {} |
78 | 78 | ||
79 | return { | 79 | return { |
80 | playlistPosition: this.playlistElement.position, | 80 | playlistPosition: this.playlistElement.position, |