id: parseInt(this.localStorageService.getItem(UserLocalStorageKeys.ID), 10),
username: this.localStorageService.getItem(UserLocalStorageKeys.USERNAME),
email: this.localStorageService.getItem(UserLocalStorageKeys.EMAIL),
- role: parseInt(this.localStorageService.getItem(UserLocalStorageKeys.ROLE), 10) as UserRole,
+ role: {
+ id: parseInt(this.localStorageService.getItem(UserLocalStorageKeys.ROLE), 10) as UserRole,
+ label: ''
+ },
...this.getUserInfo()
}
id: number
username: string
email: string
- role: UserRole
+ role: {
+ id: UserRole
+ }
}) {
this.localStorageService.setItem(UserLocalStorageKeys.ID, user.id.toString())
this.localStorageService.setItem(UserLocalStorageKeys.USERNAME, user.username)
this.localStorageService.setItem(UserLocalStorageKeys.EMAIL, user.email)
- this.localStorageService.setItem(UserLocalStorageKeys.ROLE, user.role.toString())
+ this.localStorageService.setItem(UserLocalStorageKeys.ROLE, user.role.id.toString())
}
flushLoggedInUser () {
const localStorageKeys: { [ id in keyof UserUpdateMe ]: string } = {
nsfwPolicy: UserLocalStorageKeys.NSFW_POLICY,
p2pEnabled: UserLocalStorageKeys.P2P_ENABLED,
- autoPlayNextVideo: UserLocalStorageKeys.AUTO_PLAY_VIDEO,
+ autoPlayVideo: UserLocalStorageKeys.AUTO_PLAY_VIDEO,
+ autoPlayNextVideo: UserLocalStorageKeys.AUTO_PLAY_NEXT_VIDEO,
autoPlayNextVideoPlaylist: UserLocalStorageKeys.AUTO_PLAY_VIDEO_PLAYLIST,
theme: UserLocalStorageKeys.THEME,
videoLanguages: UserLocalStorageKeys.VIDEO_LANGUAGES
UserLocalStorageKeys.NSFW_POLICY,
UserLocalStorageKeys.P2P_ENABLED,
UserLocalStorageKeys.AUTO_PLAY_VIDEO,
+ UserLocalStorageKeys.AUTO_PLAY_NEXT_VIDEO,
UserLocalStorageKeys.AUTO_PLAY_VIDEO_PLAYLIST,
UserLocalStorageKeys.THEME,
UserLocalStorageKeys.VIDEO_LANGUAGES