diff options
Diffstat (limited to 'client/src/app/helpers/utils.ts')
-rw-r--r-- | client/src/app/helpers/utils.ts | 11 |
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 | ||
48 | function 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 | |||
48 | const datePipe = new DatePipe('en') | 58 | const datePipe = new DatePipe('en') |
49 | function dateToHuman (date: string) { | 59 | function 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, |