1 import { Component, OnInit } from '@angular/core'
2 import { ServerService } from '@app/core'
3 import { peertubeLocalStorage } from '@root-helpers/peertube-web-storage'
4 import { HTMLServerConfig } from '@shared/models'
5 import { getStoredP2PEnabled } from '../../../../../assets/player/peertube-player-local-storage'
6 import { isWebRTCDisabled } from '../../../../../assets/player/utils'
9 selector: 'my-privacy-concerns',
10 templateUrl: './privacy-concerns.component.html',
11 styleUrls: [ './privacy-concerns.component.scss' ]
13 export class PrivacyConcernsComponent implements OnInit {
14 private static LOCAL_STORAGE_PRIVACY_CONCERN_KEY = 'video-watch-privacy-concern'
16 hasAlreadyAcceptedPrivacyConcern = false
18 private serverConfig: HTMLServerConfig
21 private serverService: ServerService
25 this.serverConfig = this.serverService.getHTMLConfig()
28 this.serverConfig.tracker.enabled === false ||
29 getStoredP2PEnabled() === false ||
30 peertubeLocalStorage.getItem(PrivacyConcernsComponent.LOCAL_STORAGE_PRIVACY_CONCERN_KEY) === 'true'
32 this.hasAlreadyAcceptedPrivacyConcern = true
36 declinedPrivacyConcern () {
37 peertubeLocalStorage.setItem(PrivacyConcernsComponent.LOCAL_STORAGE_PRIVACY_CONCERN_KEY, 'false')
38 this.hasAlreadyAcceptedPrivacyConcern = false
41 acceptedPrivacyConcern () {
42 peertubeLocalStorage.setItem(PrivacyConcernsComponent.LOCAL_STORAGE_PRIVACY_CONCERN_KEY, 'true')
43 this.hasAlreadyAcceptedPrivacyConcern = true