aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/core/plugins/plugin.service.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2019-07-12 11:39:58 +0200
committerChocobozzz <chocobozzz@cpy.re>2019-07-24 10:58:16 +0200
commitb5f919ac8eb2a1c20e26582fdfd377d687710d8f (patch)
tree5ec28be6f750f54bba560803ddba681103c2d82e /client/src/app/core/plugins/plugin.service.ts
parent8d2be0ed7bb87283a1ec98609df6b82d83db706a (diff)
downloadPeerTube-b5f919ac8eb2a1c20e26582fdfd377d687710d8f.tar.gz
PeerTube-b5f919ac8eb2a1c20e26582fdfd377d687710d8f.tar.zst
PeerTube-b5f919ac8eb2a1c20e26582fdfd377d687710d8f.zip
WIP plugins: update plugin
Diffstat (limited to 'client/src/app/core/plugins/plugin.service.ts')
-rw-r--r--client/src/app/core/plugins/plugin.service.ts6
1 files changed, 4 insertions, 2 deletions
diff --git a/client/src/app/core/plugins/plugin.service.ts b/client/src/app/core/plugins/plugin.service.ts
index 86bde2d02..c6ba3dd17 100644
--- a/client/src/app/core/plugins/plugin.service.ts
+++ b/client/src/app/core/plugins/plugin.service.ts
@@ -48,7 +48,9 @@ export class PluginService {
48 .toPromise() 48 .toPromise()
49 } 49 }
50 50
51 addPlugin (plugin: ServerConfigPlugin) { 51 addPlugin (plugin: ServerConfigPlugin, isTheme = false) {
52 const pathPrefix = isTheme ? '/themes' : '/plugins'
53
52 for (const key of Object.keys(plugin.clientScripts)) { 54 for (const key of Object.keys(plugin.clientScripts)) {
53 const clientScript = plugin.clientScripts[key] 55 const clientScript = plugin.clientScripts[key]
54 56
@@ -58,7 +60,7 @@ export class PluginService {
58 this.scopes[scope].push({ 60 this.scopes[scope].push({
59 plugin, 61 plugin,
60 clientScript: { 62 clientScript: {
61 script: environment.apiUrl + `/plugins/${plugin.name}/${plugin.version}/client-scripts/${clientScript.script}`, 63 script: environment.apiUrl + `${pathPrefix}/${plugin.name}/${plugin.version}/client-scripts/${clientScript.script}`,
62 scopes: clientScript.scopes 64 scopes: clientScript.scopes
63 } 65 }
64 }) 66 })