aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/core/users/user-local-storage.service.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2023-05-24 16:48:54 +0200
committerChocobozzz <me@florianbigard.com>2023-05-24 16:56:05 +0200
commit54909304287f3c04dcfb39660be8ead57dc95440 (patch)
tree478f1b913f3bd4c3bbaa17525f0114c5b0a8689d /client/src/app/core/users/user-local-storage.service.ts
parentd0fbc9fd0a29c37f3ff9b99030351e90b276fe7d (diff)
downloadPeerTube-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.ts7
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'
4import { AuthService, AuthStatus } from '@app/core/auth' 4import { AuthService, AuthStatus } from '@app/core/auth'
5import { getBoolOrDefault } from '@root-helpers/local-storage-utils' 5import { getBoolOrDefault } from '@root-helpers/local-storage-utils'
6import { logger } from '@root-helpers/logger' 6import { logger } from '@root-helpers/logger'
7import { UserLocalStorageKeys, OAuthUserTokens } from '@root-helpers/users' 7import { OAuthUserTokens, UserLocalStorageKeys } from '@root-helpers/users'
8import { objectKeysTyped } from '@shared/core-utils'
8import { UserRole, UserUpdateMe } from '@shared/models' 9import { UserRole, UserUpdateMe } from '@shared/models'
9import { NSFWPolicyType } from '@shared/models/videos' 10import { NSFWPolicyType } from '@shared/models/videos'
10import { ServerService } from '../server' 11import { 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