X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=client%2Fsrc%2Fapp%2Fcore%2Fauth%2Fauth-user.model.ts;h=97acf7bfee855938c96df40fa5b723348206738e;hb=64cc5e8575fda47b281ae20abf0020e27fc8ce7c;hp=74ed1c5806c5b0730fa957a8052257c4c4f818b8;hpb=0e5ff97f6fdf9a4cebe5a15f5a390380465803ad;p=github%2FChocobozzz%2FPeerTube.git diff --git a/client/src/app/core/auth/auth-user.model.ts b/client/src/app/core/auth/auth-user.model.ts index 74ed1c580..97acf7bfe 100644 --- a/client/src/app/core/auth/auth-user.model.ts +++ b/client/src/app/core/auth/auth-user.model.ts @@ -4,6 +4,7 @@ import { UserRight } from '../../../../../shared/models/users/user-right.enum' import { hasUserRight, UserRole } from '../../../../../shared/models/users/user-role' import { User, UserConstructorHash } from '../../shared/users/user.model' import { NSFWPolicyType } from '../../../../../shared/models/videos/nsfw-policy.type' +import { WebTorrentPolicyType } from '../../../../../shared/models/users/user-webtorrent-policy.type' export type TokenOptions = { accessToken: string @@ -72,6 +73,7 @@ export class AuthUser extends User { EMAIL: 'email', USERNAME: 'username', NSFW_POLICY: 'nsfw_policy', + WEBTORRENT_POLICY: 'peertube-videojs-' + 'webtorrent_policy', AUTO_PLAY_VIDEO: 'auto_play_video' } @@ -87,6 +89,7 @@ export class AuthUser extends User { email: peertubeLocalStorage.getItem(this.KEYS.EMAIL), role: parseInt(peertubeLocalStorage.getItem(this.KEYS.ROLE), 10) as UserRole, nsfwPolicy: peertubeLocalStorage.getItem(this.KEYS.NSFW_POLICY) as NSFWPolicyType, + webTorrentPolicy: peertubeLocalStorage.getItem(this.KEYS.WEBTORRENT_POLICY) as WebTorrentPolicyType, autoPlayVideo: peertubeLocalStorage.getItem(this.KEYS.AUTO_PLAY_VIDEO) === 'true' }, Tokens.load() @@ -101,6 +104,7 @@ export class AuthUser extends User { peertubeLocalStorage.removeItem(this.KEYS.ID) peertubeLocalStorage.removeItem(this.KEYS.ROLE) peertubeLocalStorage.removeItem(this.KEYS.NSFW_POLICY) + peertubeLocalStorage.removeItem(this.KEYS.WEBTORRENT_POLICY) peertubeLocalStorage.removeItem(this.KEYS.AUTO_PLAY_VIDEO) peertubeLocalStorage.removeItem(this.KEYS.EMAIL) Tokens.flush() @@ -138,6 +142,7 @@ export class AuthUser extends User { peertubeLocalStorage.setItem(AuthUser.KEYS.EMAIL, this.email) peertubeLocalStorage.setItem(AuthUser.KEYS.ROLE, this.role.toString()) peertubeLocalStorage.setItem(AuthUser.KEYS.NSFW_POLICY, this.nsfwPolicy.toString()) + peertubeLocalStorage.setItem(AuthUser.KEYS.WEBTORRENT_POLICY, this.webTorrentPolicy.toString()) peertubeLocalStorage.setItem(AuthUser.KEYS.AUTO_PLAY_VIDEO, JSON.stringify(this.autoPlayVideo)) this.tokens.save() }