diff options
Diffstat (limited to 'client/src/app/+videos')
-rw-r--r-- | client/src/app/+videos/+video-watch/recommendations/recommended-videos.component.ts | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/client/src/app/+videos/+video-watch/recommendations/recommended-videos.component.ts b/client/src/app/+videos/+video-watch/recommendations/recommended-videos.component.ts index 016975341..d2372023f 100644 --- a/client/src/app/+videos/+video-watch/recommendations/recommended-videos.component.ts +++ b/client/src/app/+videos/+video-watch/recommendations/recommended-videos.component.ts | |||
@@ -7,6 +7,7 @@ import { VideoPlaylist } from '@app/shared/shared-video-playlist' | |||
7 | import { I18n } from '@ngx-translate/i18n-polyfill' | 7 | import { I18n } from '@ngx-translate/i18n-polyfill' |
8 | import { RecommendationInfo } from './recommendation-info.model' | 8 | import { RecommendationInfo } from './recommendation-info.model' |
9 | import { RecommendedVideosStore } from './recommended-videos.store' | 9 | import { RecommendedVideosStore } from './recommended-videos.store' |
10 | import { UserLocalStorageKeys } from '@root-helpers/users' | ||
10 | 11 | ||
11 | @Component({ | 12 | @Component({ |
12 | selector: 'my-recommended-videos', | 13 | selector: 'my-recommended-videos', |
@@ -48,9 +49,12 @@ export class RecommendedVideosComponent implements OnInit, OnChanges { | |||
48 | if (this.authService.isLoggedIn()) { | 49 | if (this.authService.isLoggedIn()) { |
49 | this.autoPlayNextVideo = this.authService.getUser().autoPlayNextVideo | 50 | this.autoPlayNextVideo = this.authService.getUser().autoPlayNextVideo |
50 | } else { | 51 | } else { |
51 | this.autoPlayNextVideo = this.sessionStorageService.getItem(User.KEYS.SESSION_STORAGE_AUTO_PLAY_NEXT_VIDEO) === 'true' || false | 52 | this.autoPlayNextVideo = this.sessionStorageService.getItem(UserLocalStorageKeys.SESSION_STORAGE_AUTO_PLAY_NEXT_VIDEO) === 'true' |
52 | this.sessionStorageService.watch([User.KEYS.SESSION_STORAGE_AUTO_PLAY_NEXT_VIDEO]).subscribe( | 53 | |
53 | () => this.autoPlayNextVideo = this.sessionStorageService.getItem(User.KEYS.SESSION_STORAGE_AUTO_PLAY_NEXT_VIDEO) === 'true' | 54 | this.sessionStorageService.watch([UserLocalStorageKeys.SESSION_STORAGE_AUTO_PLAY_NEXT_VIDEO]).subscribe( |
55 | () => { | ||
56 | this.autoPlayNextVideo = this.sessionStorageService.getItem(UserLocalStorageKeys.SESSION_STORAGE_AUTO_PLAY_NEXT_VIDEO) === 'true' | ||
57 | } | ||
54 | ) | 58 | ) |
55 | } | 59 | } |
56 | 60 | ||
@@ -73,7 +77,7 @@ export class RecommendedVideosComponent implements OnInit, OnChanges { | |||
73 | } | 77 | } |
74 | 78 | ||
75 | switchAutoPlayNextVideo () { | 79 | switchAutoPlayNextVideo () { |
76 | this.sessionStorageService.setItem(User.KEYS.SESSION_STORAGE_AUTO_PLAY_NEXT_VIDEO, this.autoPlayNextVideo.toString()) | 80 | this.sessionStorageService.setItem(UserLocalStorageKeys.SESSION_STORAGE_AUTO_PLAY_NEXT_VIDEO, this.autoPlayNextVideo.toString()) |
77 | 81 | ||
78 | if (this.authService.isLoggedIn()) { | 82 | if (this.authService.isLoggedIn()) { |
79 | const details = { | 83 | const details = { |