blob: b1e8bf989e1c3476af8e9d6867dff2ae331fa5ef (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
|
import { Component, OnInit } from '@angular/core'
import { ServerService } from '@app/core'
import { peertubeLocalStorage } from '@root-helpers/peertube-web-storage'
import { HTMLServerConfig } from '@shared/models'
import { getStoredP2PEnabled } from '../../../../../assets/player/peertube-player-local-storage'
import { isWebRTCDisabled } from '../../../../../assets/player/utils'
@Component({
selector: 'my-privacy-concerns',
templateUrl: './privacy-concerns.component.html',
styleUrls: [ './privacy-concerns.component.scss' ]
})
export class PrivacyConcernsComponent implements OnInit {
private static LOCAL_STORAGE_PRIVACY_CONCERN_KEY = 'video-watch-privacy-concern'
hasAlreadyAcceptedPrivacyConcern = false
private serverConfig: HTMLServerConfig
constructor (
private serverService: ServerService
) { }
ngOnInit () {
this.serverConfig = this.serverService.getHTMLConfig()
if (
isWebRTCDisabled() ||
this.serverConfig.tracker.enabled === false ||
getStoredP2PEnabled() === false ||
peertubeLocalStorage.getItem(PrivacyConcernsComponent.LOCAL_STORAGE_PRIVACY_CONCERN_KEY) === 'true'
) {
this.hasAlreadyAcceptedPrivacyConcern = true
}
}
declinedPrivacyConcern () {
peertubeLocalStorage.setItem(PrivacyConcernsComponent.LOCAL_STORAGE_PRIVACY_CONCERN_KEY, 'false')
this.hasAlreadyAcceptedPrivacyConcern = false
}
acceptedPrivacyConcern () {
peertubeLocalStorage.setItem(PrivacyConcernsComponent.LOCAL_STORAGE_PRIVACY_CONCERN_KEY, 'true')
this.hasAlreadyAcceptedPrivacyConcern = true
}
}
|