diff options
author | Chocobozzz <me@florianbigard.com> | 2023-05-24 16:48:54 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2023-05-24 16:56:05 +0200 |
commit | 54909304287f3c04dcfb39660be8ead57dc95440 (patch) | |
tree | 478f1b913f3bd4c3bbaa17525f0114c5b0a8689d /client/src/app/core/users/user-local-storage.service.ts | |
parent | d0fbc9fd0a29c37f3ff9b99030351e90b276fe7d (diff) | |
download | PeerTube-54909304287f3c04dcfb39660be8ead57dc95440.tar.gz PeerTube-54909304287f3c04dcfb39660be8ead57dc95440.tar.zst PeerTube-54909304287f3c04dcfb39660be8ead57dc95440.zip |
Remove suppressImplicitAnyIndexErrors
It's deprecated by TS
Diffstat (limited to 'client/src/app/core/users/user-local-storage.service.ts')
-rw-r--r-- | client/src/app/core/users/user-local-storage.service.ts | 7 |
1 files changed, 4 insertions, 3 deletions
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' | |||
4 | import { AuthService, AuthStatus } from '@app/core/auth' | 4 | import { AuthService, AuthStatus } from '@app/core/auth' |
5 | import { getBoolOrDefault } from '@root-helpers/local-storage-utils' | 5 | import { getBoolOrDefault } from '@root-helpers/local-storage-utils' |
6 | import { logger } from '@root-helpers/logger' | 6 | import { logger } from '@root-helpers/logger' |
7 | import { UserLocalStorageKeys, OAuthUserTokens } from '@root-helpers/users' | 7 | import { OAuthUserTokens, UserLocalStorageKeys } from '@root-helpers/users' |
8 | import { objectKeysTyped } from '@shared/core-utils' | ||
8 | import { UserRole, UserUpdateMe } from '@shared/models' | 9 | import { UserRole, UserUpdateMe } from '@shared/models' |
9 | import { NSFWPolicyType } from '@shared/models/videos' | 10 | import { NSFWPolicyType } from '@shared/models/videos' |
10 | import { ServerService } from '../server' | 11 | import { ServerService } from '../server' |
@@ -122,7 +123,7 @@ export class UserLocalStorageService { | |||
122 | } | 123 | } |
123 | 124 | ||
124 | setUserInfo (profile: UserUpdateMe) { | 125 | setUserInfo (profile: UserUpdateMe) { |
125 | const localStorageKeys: { [ id in keyof UserUpdateMe ]: string } = { | 126 | const localStorageKeys = { |
126 | nsfwPolicy: UserLocalStorageKeys.NSFW_POLICY, | 127 | nsfwPolicy: UserLocalStorageKeys.NSFW_POLICY, |
127 | p2pEnabled: UserLocalStorageKeys.P2P_ENABLED, | 128 | p2pEnabled: UserLocalStorageKeys.P2P_ENABLED, |
128 | autoPlayVideo: UserLocalStorageKeys.AUTO_PLAY_VIDEO, | 129 | autoPlayVideo: UserLocalStorageKeys.AUTO_PLAY_VIDEO, |
@@ -132,7 +133,7 @@ export class UserLocalStorageService { | |||
132 | videoLanguages: UserLocalStorageKeys.VIDEO_LANGUAGES | 133 | videoLanguages: UserLocalStorageKeys.VIDEO_LANGUAGES |
133 | } | 134 | } |
134 | 135 | ||
135 | const obj = Object.keys(localStorageKeys) | 136 | const obj: [ string, string | boolean | string[] ][] = objectKeysTyped(localStorageKeys) |
136 | .filter(key => key in profile) | 137 | .filter(key => key in profile) |
137 | .map(key => ([ localStorageKeys[key], profile[key] ])) | 138 | .map(key => ([ localStorageKeys[key], profile[key] ])) |
138 | 139 | ||