diff options
author | Chocobozzz <me@florianbigard.com> | 2018-03-23 14:26:20 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2018-03-23 14:26:20 +0100 |
commit | 0bd78bf30b2ae159791bdc90d17ed18e0327f621 (patch) | |
tree | e8f69cef499a99c51deeea39f7197b7ff93a80a2 /client/src/app/videos | |
parent | 9c673970f66fe91c665e1e3905fa768f57e11a18 (diff) | |
download | PeerTube-0bd78bf30b2ae159791bdc90d17ed18e0327f621.tar.gz PeerTube-0bd78bf30b2ae159791bdc90d17ed18e0327f621.tar.zst PeerTube-0bd78bf30b2ae159791bdc90d17ed18e0327f621.zip |
Proxify local storage and handle if it is unavailable
Diffstat (limited to 'client/src/app/videos')
-rw-r--r-- | client/src/app/videos/+video-watch/video-watch.component.ts | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/client/src/app/videos/+video-watch/video-watch.component.ts b/client/src/app/videos/+video-watch/video-watch.component.ts index b60e58fb0..fda69efab 100644 --- a/client/src/app/videos/+video-watch/video-watch.component.ts +++ b/client/src/app/videos/+video-watch/video-watch.component.ts | |||
@@ -1,6 +1,7 @@ | |||
1 | import { Component, ElementRef, NgZone, OnDestroy, OnInit, ViewChild } from '@angular/core' | 1 | import { Component, ElementRef, NgZone, OnDestroy, OnInit, ViewChild } from '@angular/core' |
2 | import { ActivatedRoute, Router } from '@angular/router' | 2 | import { ActivatedRoute, Router } from '@angular/router' |
3 | import { RedirectService } from '@app/core/routing/redirect.service' | 3 | import { RedirectService } from '@app/core/routing/redirect.service' |
4 | import { peertubeLocalStorage } from '@app/shared/misc/peertube-local-storage' | ||
4 | import { VideoSupportComponent } from '@app/videos/+video-watch/modal/video-support.component' | 5 | import { VideoSupportComponent } from '@app/videos/+video-watch/modal/video-support.component' |
5 | import { MetaService } from '@ngx-meta/core' | 6 | import { MetaService } from '@ngx-meta/core' |
6 | import { NotificationsService } from 'angular2-notifications' | 7 | import { NotificationsService } from 'angular2-notifications' |
@@ -75,7 +76,10 @@ export class VideoWatchComponent implements OnInit, OnDestroy { | |||
75 | } | 76 | } |
76 | 77 | ||
77 | ngOnInit () { | 78 | ngOnInit () { |
78 | if (WebTorrent.WEBRTC_SUPPORT === false || localStorage.getItem(VideoWatchComponent.LOCAL_STORAGE_PRIVACY_CONCERN_KEY) === 'true') { | 79 | if ( |
80 | WebTorrent.WEBRTC_SUPPORT === false || | ||
81 | peertubeLocalStorage.getItem(VideoWatchComponent.LOCAL_STORAGE_PRIVACY_CONCERN_KEY) === 'true' | ||
82 | ) { | ||
79 | this.hasAlreadyAcceptedPrivacyConcern = true | 83 | this.hasAlreadyAcceptedPrivacyConcern = true |
80 | } | 84 | } |
81 | 85 | ||
@@ -262,7 +266,7 @@ export class VideoWatchComponent implements OnInit, OnDestroy { | |||
262 | } | 266 | } |
263 | 267 | ||
264 | acceptedPrivacyConcern () { | 268 | acceptedPrivacyConcern () { |
265 | localStorage.setItem(VideoWatchComponent.LOCAL_STORAGE_PRIVACY_CONCERN_KEY, 'true') | 269 | peertubeLocalStorage.setItem(VideoWatchComponent.LOCAL_STORAGE_PRIVACY_CONCERN_KEY, 'true') |
266 | this.hasAlreadyAcceptedPrivacyConcern = true | 270 | this.hasAlreadyAcceptedPrivacyConcern = true |
267 | } | 271 | } |
268 | 272 | ||