aboutsummaryrefslogtreecommitdiffhomepage
path: root/client
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2021-12-16 09:38:27 +0100
committerChocobozzz <me@florianbigard.com>2021-12-16 10:08:55 +0100
commitb65de1be4dcf626c552be613d531d3f6e23c6085 (patch)
tree42c4d7440f9fadee6efb48ad39ccfe1a3bce8511 /client
parent9576506763c20c7efbdb229483440a1fc984cf4d (diff)
downloadPeerTube-b65de1be4dcf626c552be613d531d3f6e23c6085.tar.gz
PeerTube-b65de1be4dcf626c552be613d531d3f6e23c6085.tar.zst
PeerTube-b65de1be4dcf626c552be613d531d3f6e23c6085.zip
Use different p2p policy for embeds and webapp
Diffstat (limited to 'client')
-rw-r--r--client/e2e/src/utils/hooks.ts7
-rw-r--r--client/src/app/core/users/user-local-storage.service.ts2
-rw-r--r--client/src/standalone/videos/embed.ts2
3 files changed, 8 insertions, 3 deletions
diff --git a/client/e2e/src/utils/hooks.ts b/client/e2e/src/utils/hooks.ts
index 2f3d10fe3..e139d8183 100644
--- a/client/e2e/src/utils/hooks.ts
+++ b/client/e2e/src/utils/hooks.ts
@@ -57,7 +57,12 @@ function buildConfig (suiteFile: string = undefined) {
57 licence: 4 57 licence: 4
58 }, 58 },
59 p2p: { 59 p2p: {
60 enabled: false 60 webapp: {
61 enabled: false
62 },
63 embed: {
64 enabled: false
65 }
61 } 66 }
62 } 67 }
63 } 68 }
diff --git a/client/src/app/core/users/user-local-storage.service.ts b/client/src/app/core/users/user-local-storage.service.ts
index 85da46e0d..d15bf735b 100644
--- a/client/src/app/core/users/user-local-storage.service.ts
+++ b/client/src/app/core/users/user-local-storage.service.ts
@@ -101,7 +101,7 @@ export class UserLocalStorageService {
101 const htmlConfig = this.server.getHTMLConfig() 101 const htmlConfig = this.server.getHTMLConfig()
102 102
103 const defaultNSFWPolicy = htmlConfig.instance.defaultNSFWPolicy 103 const defaultNSFWPolicy = htmlConfig.instance.defaultNSFWPolicy
104 const defaultP2PEnabled = htmlConfig.defaults.p2p.enabled 104 const defaultP2PEnabled = htmlConfig.defaults.p2p.webapp.enabled
105 105
106 return { 106 return {
107 nsfwPolicy: this.localStorageService.getItem<NSFWPolicyType>(UserLocalStorageKeys.NSFW_POLICY) || defaultNSFWPolicy, 107 nsfwPolicy: this.localStorageService.getItem<NSFWPolicyType>(UserLocalStorageKeys.NSFW_POLICY) || defaultNSFWPolicy,
diff --git a/client/src/standalone/videos/embed.ts b/client/src/standalone/videos/embed.ts
index 94f1096b7..c04f94d20 100644
--- a/client/src/standalone/videos/embed.ts
+++ b/client/src/standalone/videos/embed.ts
@@ -793,7 +793,7 @@ export class PeerTubeEmbed {
793 private isP2PEnabled (video: Video) { 793 private isP2PEnabled (video: Video) {
794 const userP2PEnabled = getBoolOrDefault( 794 const userP2PEnabled = getBoolOrDefault(
795 peertubeLocalStorage.getItem(UserLocalStorageKeys.P2P_ENABLED), 795 peertubeLocalStorage.getItem(UserLocalStorageKeys.P2P_ENABLED),
796 this.config.defaults.p2p.enabled 796 this.config.defaults.p2p.embed.enabled
797 ) 797 )
798 798
799 return isP2PEnabled(video, this.config, userP2PEnabled) 799 return isP2PEnabled(video, this.config, userP2PEnabled)