diff options
author | Rigel Kent <sendmemail@rigelk.eu> | 2020-02-28 13:52:21 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-02-28 13:52:21 +0100 |
commit | d3217560a611b94f888ecf3de93b428a7521d4de (patch) | |
tree | 26fc984f351afb994dc13c94e138476ded50c76a /client/src/app/shared/users/user.model.ts | |
parent | 64645512b08875c18ebdc009a550cdfa69def955 (diff) | |
download | PeerTube-d3217560a611b94f888ecf3de93b428a7521d4de.tar.gz PeerTube-d3217560a611b94f888ecf3de93b428a7521d4de.tar.zst PeerTube-d3217560a611b94f888ecf3de93b428a7521d4de.zip |
Add visitor settings, rework logged-in dropdown (#2514)
* Add visitor settings, rework logged-in dropdown
* Make user dropdown P2P switch functional
* Fix lint
* Fix unnecessary notification when user logs out
* Simplify visitor settings code and remove unnecessary icons
* Catch parsing errors and reindent menu styles
Diffstat (limited to 'client/src/app/shared/users/user.model.ts')
-rw-r--r-- | client/src/app/shared/users/user.model.ts | 29 |
1 files changed, 27 insertions, 2 deletions
diff --git a/client/src/app/shared/users/user.model.ts b/client/src/app/shared/users/user.model.ts index 7707d7dda..a37cae749 100644 --- a/client/src/app/shared/users/user.model.ts +++ b/client/src/app/shared/users/user.model.ts | |||
@@ -1,10 +1,32 @@ | |||
1 | import { hasUserRight, User as UserServerModel, UserNotificationSetting, UserRight, UserRole, VideoChannel } from '../../../../../shared' | 1 | import { |
2 | hasUserRight, | ||
3 | User as UserServerModel, | ||
4 | UserNotificationSetting, | ||
5 | UserRight, | ||
6 | UserRole | ||
7 | } from '../../../../../shared/models/users' | ||
8 | import { VideoChannel } from '../../../../../shared/models/videos' | ||
2 | import { NSFWPolicyType } from '../../../../../shared/models/videos/nsfw-policy.type' | 9 | import { NSFWPolicyType } from '../../../../../shared/models/videos/nsfw-policy.type' |
3 | import { Account } from '@app/shared/account/account.model' | 10 | import { Account } from '@app/shared/account/account.model' |
4 | import { Avatar } from '../../../../../shared/models/avatars/avatar.model' | 11 | import { Avatar } from '../../../../../shared/models/avatars/avatar.model' |
5 | import { UserAdminFlag } from '@shared/models/users/user-flag.model' | 12 | import { UserAdminFlag } from '@shared/models/users/user-flag.model' |
6 | 13 | ||
7 | export class User implements UserServerModel { | 14 | export class User implements UserServerModel { |
15 | static KEYS = { | ||
16 | ID: 'id', | ||
17 | ROLE: 'role', | ||
18 | EMAIL: 'email', | ||
19 | VIDEOS_HISTORY_ENABLED: 'videos-history-enabled', | ||
20 | USERNAME: 'username', | ||
21 | NSFW_POLICY: 'nsfw_policy', | ||
22 | WEBTORRENT_ENABLED: 'peertube-videojs-' + 'webtorrent_enabled', | ||
23 | AUTO_PLAY_VIDEO: 'auto_play_video', | ||
24 | SESSION_STORAGE_AUTO_PLAY_NEXT_VIDEO: 'auto_play_next_video', | ||
25 | AUTO_PLAY_VIDEO_PLAYLIST: 'auto_play_video_playlist', | ||
26 | THEME: 'last_active_theme', | ||
27 | VIDEO_LANGUAGES: 'video_languages' | ||
28 | } | ||
29 | |||
8 | id: number | 30 | id: number |
9 | username: string | 31 | username: string |
10 | email: string | 32 | email: string |
@@ -60,8 +82,11 @@ export class User implements UserServerModel { | |||
60 | 82 | ||
61 | this.nsfwPolicy = hash.nsfwPolicy | 83 | this.nsfwPolicy = hash.nsfwPolicy |
62 | this.webTorrentEnabled = hash.webTorrentEnabled | 84 | this.webTorrentEnabled = hash.webTorrentEnabled |
63 | this.videosHistoryEnabled = hash.videosHistoryEnabled | ||
64 | this.autoPlayVideo = hash.autoPlayVideo | 85 | this.autoPlayVideo = hash.autoPlayVideo |
86 | this.autoPlayNextVideo = hash.autoPlayNextVideo | ||
87 | this.autoPlayNextVideoPlaylist = hash.autoPlayNextVideoPlaylist | ||
88 | this.videosHistoryEnabled = hash.videosHistoryEnabled | ||
89 | this.videoLanguages = hash.videoLanguages | ||
65 | 90 | ||
66 | this.theme = hash.theme | 91 | this.theme = hash.theme |
67 | 92 | ||