diff options
Diffstat (limited to 'client/src/app/core/auth/auth-user.model.ts')
-rw-r--r-- | client/src/app/core/auth/auth-user.model.ts | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/client/src/app/core/auth/auth-user.model.ts b/client/src/app/core/auth/auth-user.model.ts index 7b6c8816f..9ad275392 100644 --- a/client/src/app/core/auth/auth-user.model.ts +++ b/client/src/app/core/auth/auth-user.model.ts | |||
@@ -69,7 +69,8 @@ export class AuthUser extends User { | |||
69 | ROLE: 'role', | 69 | ROLE: 'role', |
70 | EMAIL: 'email', | 70 | EMAIL: 'email', |
71 | USERNAME: 'username', | 71 | USERNAME: 'username', |
72 | DISPLAY_NSFW: 'display_nsfw' | 72 | DISPLAY_NSFW: 'display_nsfw', |
73 | AUTO_PLAY_VIDEO: 'auto_play_video' | ||
73 | } | 74 | } |
74 | 75 | ||
75 | tokens: Tokens | 76 | tokens: Tokens |
@@ -83,7 +84,8 @@ export class AuthUser extends User { | |||
83 | username: localStorage.getItem(this.KEYS.USERNAME), | 84 | username: localStorage.getItem(this.KEYS.USERNAME), |
84 | email: localStorage.getItem(this.KEYS.EMAIL), | 85 | email: localStorage.getItem(this.KEYS.EMAIL), |
85 | role: parseInt(localStorage.getItem(this.KEYS.ROLE), 10) as UserRole, | 86 | role: parseInt(localStorage.getItem(this.KEYS.ROLE), 10) as UserRole, |
86 | displayNSFW: localStorage.getItem(this.KEYS.DISPLAY_NSFW) === 'true' | 87 | displayNSFW: localStorage.getItem(this.KEYS.DISPLAY_NSFW) === 'true', |
88 | autoPlayVideo: localStorage.getItem(this.KEYS.AUTO_PLAY_VIDEO) === 'true' | ||
87 | }, | 89 | }, |
88 | Tokens.load() | 90 | Tokens.load() |
89 | ) | 91 | ) |
@@ -97,6 +99,7 @@ export class AuthUser extends User { | |||
97 | localStorage.removeItem(this.KEYS.ID) | 99 | localStorage.removeItem(this.KEYS.ID) |
98 | localStorage.removeItem(this.KEYS.ROLE) | 100 | localStorage.removeItem(this.KEYS.ROLE) |
99 | localStorage.removeItem(this.KEYS.DISPLAY_NSFW) | 101 | localStorage.removeItem(this.KEYS.DISPLAY_NSFW) |
102 | localStorage.removeItem(this.KEYS.AUTO_PLAY_VIDEO) | ||
100 | localStorage.removeItem(this.KEYS.EMAIL) | 103 | localStorage.removeItem(this.KEYS.EMAIL) |
101 | Tokens.flush() | 104 | Tokens.flush() |
102 | } | 105 | } |
@@ -133,6 +136,7 @@ export class AuthUser extends User { | |||
133 | localStorage.setItem(AuthUser.KEYS.EMAIL, this.email) | 136 | localStorage.setItem(AuthUser.KEYS.EMAIL, this.email) |
134 | localStorage.setItem(AuthUser.KEYS.ROLE, this.role.toString()) | 137 | localStorage.setItem(AuthUser.KEYS.ROLE, this.role.toString()) |
135 | localStorage.setItem(AuthUser.KEYS.DISPLAY_NSFW, JSON.stringify(this.displayNSFW)) | 138 | localStorage.setItem(AuthUser.KEYS.DISPLAY_NSFW, JSON.stringify(this.displayNSFW)) |
139 | localStorage.setItem(AuthUser.KEYS.AUTO_PLAY_VIDEO, JSON.stringify(this.autoPlayVideo)) | ||
136 | this.tokens.save() | 140 | this.tokens.save() |
137 | } | 141 | } |
138 | } | 142 | } |