diff options
author | Chocobozzz <me@florianbigard.com> | 2020-08-06 15:25:19 +0200 |
---|---|---|
committer | Chocobozzz <chocobozzz@cpy.re> | 2020-08-07 08:55:02 +0200 |
commit | a4ff3100d36f2fe9a4dfc00e8487c28a94433c4f (patch) | |
tree | 1744c9db32b765b1511d4a69a7ba7b525dc0f619 /client/src/app/+videos | |
parent | a02b93ce756d646a59cef57b5e4ff53c2bb30bec (diff) | |
download | PeerTube-a4ff3100d36f2fe9a4dfc00e8487c28a94433c4f.tar.gz PeerTube-a4ff3100d36f2fe9a4dfc00e8487c28a94433c4f.tar.zst PeerTube-a4ff3100d36f2fe9a4dfc00e8487c28a94433c4f.zip |
Cleanup tokens logic in embed
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 = { |