From c199c427d4ae586339822320f20f512a7a19dc3f Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Thu, 18 Oct 2018 14:35:31 +0200 Subject: Better typings --- .../my-account-videos/my-account-videos.component.ts | 11 +++++------ .../video-change-ownership.component.ts | 3 +-- 2 files changed, 6 insertions(+), 8 deletions(-) (limited to 'client/src/app/+my-account/my-account-videos') diff --git a/client/src/app/+my-account/my-account-videos/my-account-videos.component.ts b/client/src/app/+my-account/my-account-videos/my-account-videos.component.ts index 52307f09e..2d88ac760 100644 --- a/client/src/app/+my-account/my-account-videos/my-account-videos.component.ts +++ b/client/src/app/+my-account/my-account-videos/my-account-videos.component.ts @@ -66,7 +66,7 @@ export class MyAccountVideosComponent extends AbstractVideoList implements OnIni } isInSelectionMode () { - return Object.keys(this.checkedVideos).some((k: any) => this.checkedVideos[ k ] === true) + return Object.keys(this.checkedVideos).some(k => this.checkedVideos[ k ] === true) } getVideosObservable (page: number) { @@ -81,7 +81,7 @@ export class MyAccountVideosComponent extends AbstractVideoList implements OnIni async deleteSelectedVideos () { const toDeleteVideosIds = Object.keys(this.checkedVideos) - .filter((k: any) => this.checkedVideos[ k ] === true) + .filter(k => this.checkedVideos[ k ] === true) .map(k => parseInt(k, 10)) const res = await this.confirmService.confirm( @@ -168,10 +168,9 @@ export class MyAccountVideosComponent extends AbstractVideoList implements OnIni } private spliceVideosById (id: number) { - let key: any - for (key of Object.keys(this.loadedPages)) { - const videos = this.loadedPages[ key ] - const index = videos.findIndex((v: any) => v.id === id) + for (const key of Object.keys(this.loadedPages)) { + const videos: Video[] = this.loadedPages[ key ] + const index = videos.findIndex(v => v.id === id) if (index !== -1) { videos.splice(index, 1) diff --git a/client/src/app/+my-account/my-account-videos/video-change-ownership/video-change-ownership.component.ts b/client/src/app/+my-account/my-account-videos/video-change-ownership/video-change-ownership.component.ts index eb3f9404f..9f94f3c13 100644 --- a/client/src/app/+my-account/my-account-videos/video-change-ownership/video-change-ownership.component.ts +++ b/client/src/app/+my-account/my-account-videos/video-change-ownership/video-change-ownership.component.ts @@ -49,8 +49,7 @@ export class VideoChangeOwnershipComponent extends FormReactive implements OnIni .catch((_) => _) // Called when closing (cancel) the modal without validating, do nothing } - // TODO: typing - search (event: any) { + search (event: { query: string }) { const query = event.query this.userService.autocomplete(query) .subscribe( -- cgit v1.2.3