From 54909304287f3c04dcfb39660be8ead57dc95440 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Wed, 24 May 2023 16:48:54 +0200 Subject: Remove suppressImplicitAnyIndexErrors It's deprecated by TS --- client/src/app/core/users/user-local-storage.service.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'client/src/app/core/users/user-local-storage.service.ts') diff --git a/client/src/app/core/users/user-local-storage.service.ts b/client/src/app/core/users/user-local-storage.service.ts index 1e629249a..a87f3b98a 100644 --- a/client/src/app/core/users/user-local-storage.service.ts +++ b/client/src/app/core/users/user-local-storage.service.ts @@ -4,7 +4,8 @@ import { Injectable } from '@angular/core' import { AuthService, AuthStatus } from '@app/core/auth' import { getBoolOrDefault } from '@root-helpers/local-storage-utils' import { logger } from '@root-helpers/logger' -import { UserLocalStorageKeys, OAuthUserTokens } from '@root-helpers/users' +import { OAuthUserTokens, UserLocalStorageKeys } from '@root-helpers/users' +import { objectKeysTyped } from '@shared/core-utils' import { UserRole, UserUpdateMe } from '@shared/models' import { NSFWPolicyType } from '@shared/models/videos' import { ServerService } from '../server' @@ -122,7 +123,7 @@ export class UserLocalStorageService { } setUserInfo (profile: UserUpdateMe) { - const localStorageKeys: { [ id in keyof UserUpdateMe ]: string } = { + const localStorageKeys = { nsfwPolicy: UserLocalStorageKeys.NSFW_POLICY, p2pEnabled: UserLocalStorageKeys.P2P_ENABLED, autoPlayVideo: UserLocalStorageKeys.AUTO_PLAY_VIDEO, @@ -132,7 +133,7 @@ export class UserLocalStorageService { videoLanguages: UserLocalStorageKeys.VIDEO_LANGUAGES } - const obj = Object.keys(localStorageKeys) + const obj: [ string, string | boolean | string[] ][] = objectKeysTyped(localStorageKeys) .filter(key => key in profile) .map(key => ([ localStorageKeys[key], profile[key] ])) -- cgit v1.2.3