aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/videos
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2018-03-23 14:26:20 +0100
committerChocobozzz <me@florianbigard.com>2018-03-23 14:26:20 +0100
commit0bd78bf30b2ae159791bdc90d17ed18e0327f621 (patch)
treee8f69cef499a99c51deeea39f7197b7ff93a80a2 /client/src/app/videos
parent9c673970f66fe91c665e1e3905fa768f57e11a18 (diff)
downloadPeerTube-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.ts8
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 @@
1import { Component, ElementRef, NgZone, OnDestroy, OnInit, ViewChild } from '@angular/core' 1import { Component, ElementRef, NgZone, OnDestroy, OnInit, ViewChild } from '@angular/core'
2import { ActivatedRoute, Router } from '@angular/router' 2import { ActivatedRoute, Router } from '@angular/router'
3import { RedirectService } from '@app/core/routing/redirect.service' 3import { RedirectService } from '@app/core/routing/redirect.service'
4import { peertubeLocalStorage } from '@app/shared/misc/peertube-local-storage'
4import { VideoSupportComponent } from '@app/videos/+video-watch/modal/video-support.component' 5import { VideoSupportComponent } from '@app/videos/+video-watch/modal/video-support.component'
5import { MetaService } from '@ngx-meta/core' 6import { MetaService } from '@ngx-meta/core'
6import { NotificationsService } from 'angular2-notifications' 7import { 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