1
0
Fork 0
mirror of https://github.com/Chocobozzz/PeerTube.git synced 2025-10-05 19:42:24 +02:00

WIP plugins: load theme on client side

This commit is contained in:
Chocobozzz 2019-07-10 14:06:19 +02:00 committed by Chocobozzz
parent 7cd4d2ba10
commit ffb321bedc
19 changed files with 194 additions and 91 deletions

View file

@ -44,7 +44,7 @@ import { VideoChannelModel } from '../video/video-channel'
import { AccountModel } from './account'
import { NSFWPolicyType } from '../../../shared/models/videos/nsfw-policy.type'
import { values } from 'lodash'
import { DEFAULT_THEME, NSFW_POLICY_TYPES } from '../../initializers/constants'
import { DEFAULT_THEME_NAME, DEFAULT_USER_THEME_NAME, NSFW_POLICY_TYPES } from '../../initializers/constants'
import { clearCacheByUserId } from '../../lib/oauth-model'
import { UserNotificationSettingModel } from './user-notification-setting'
import { VideoModel } from '../video/video'
@ -190,7 +190,7 @@ export class UserModel extends Model<UserModel> {
videoQuotaDaily: number
@AllowNull(false)
@Default(DEFAULT_THEME)
@Default(DEFAULT_THEME_NAME)
@Is('UserTheme', value => throwIfNotValid(value, isThemeValid, 'theme'))
@Column
theme: string
@ -568,7 +568,7 @@ export class UserModel extends Model<UserModel> {
autoPlayVideo: this.autoPlayVideo,
videoLanguages: this.videoLanguages,
role: this.role,
theme: getThemeOrDefault(this.theme),
theme: getThemeOrDefault(this.theme, DEFAULT_USER_THEME_NAME),
roleLabel: USER_ROLE_LABELS[ this.role ],
videoQuota: this.videoQuota,
videoQuotaDaily: this.videoQuotaDaily,