aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/helpers/utils.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2020-07-10 11:13:41 +0200
committerChocobozzz <me@florianbigard.com>2020-07-10 11:13:41 +0200
commit72493e44e9b455a04c4f093ed6c6ffa300b98d8b (patch)
treefc39d2b119ffbbf76339cf1dc2a9bd160c35c304 /client/src/app/helpers/utils.ts
parent1fdf8edb77008133e80e5ab8e846b7f8fdfecf12 (diff)
downloadPeerTube-72493e44e9b455a04c4f093ed6c6ffa300b98d8b.tar.gz
PeerTube-72493e44e9b455a04c4f093ed6c6ffa300b98d8b.tar.zst
PeerTube-72493e44e9b455a04c4f093ed6c6ffa300b98d8b.zip
Fix embed url
Diffstat (limited to 'client/src/app/helpers/utils.ts')
-rw-r--r--client/src/app/helpers/utils.ts11
1 files changed, 11 insertions, 0 deletions
diff --git a/client/src/app/helpers/utils.ts b/client/src/app/helpers/utils.ts
index 879f697f4..9bf22f62f 100644
--- a/client/src/app/helpers/utils.ts
+++ b/client/src/app/helpers/utils.ts
@@ -45,6 +45,16 @@ function getAbsoluteAPIUrl () {
45 return absoluteAPIUrl 45 return absoluteAPIUrl
46} 46}
47 47
48function getAbsoluteEmbedUrl () {
49 let absoluteEmbedUrl = environment.embedUrl
50 if (!absoluteEmbedUrl) {
51 // The Embed is on the same domain
52 absoluteEmbedUrl = window.location.origin
53 }
54
55 return absoluteEmbedUrl
56}
57
48const datePipe = new DatePipe('en') 58const datePipe = new DatePipe('en')
49function dateToHuman (date: string) { 59function dateToHuman (date: string) {
50 return datePipe.transform(date, 'medium') 60 return datePipe.transform(date, 'medium')
@@ -201,6 +211,7 @@ export {
201 dateToHuman, 211 dateToHuman,
202 immutableAssign, 212 immutableAssign,
203 objectToFormData, 213 objectToFormData,
214 getAbsoluteEmbedUrl,
204 objectLineFeedToHtml, 215 objectLineFeedToHtml,
205 removeElementFromArray, 216 removeElementFromArray,
206 importModule, 217 importModule,