diff options
Diffstat (limited to 'client/src/app/shared/misc')
-rw-r--r-- | client/src/app/shared/misc/utils.ts | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/client/src/app/shared/misc/utils.ts b/client/src/app/shared/misc/utils.ts index 5525e4efb..2739ff81a 100644 --- a/client/src/app/shared/misc/utils.ts +++ b/client/src/app/shared/misc/utils.ts | |||
@@ -1,5 +1,6 @@ | |||
1 | // Thanks: https://stackoverflow.com/questions/901115/how-can-i-get-query-string-values-in-javascript | 1 | // Thanks: https://stackoverflow.com/questions/901115/how-can-i-get-query-string-values-in-javascript |
2 | 2 | ||
3 | import { environment } from '../../../environments/environment' | ||
3 | import { AuthService } from '../../core/auth' | 4 | import { AuthService } from '../../core/auth' |
4 | 5 | ||
5 | function getParameterByName (name: string, url: string) { | 6 | function getParameterByName (name: string, url: string) { |
@@ -38,8 +39,19 @@ function populateAsyncUserVideoChannels (authService: AuthService, channel: any[ | |||
38 | }) | 39 | }) |
39 | } | 40 | } |
40 | 41 | ||
42 | function getAbsoluteAPIUrl () { | ||
43 | let absoluteAPIUrl = environment.apiUrl | ||
44 | if (!absoluteAPIUrl) { | ||
45 | // The API is on the same domain | ||
46 | absoluteAPIUrl = window.location.origin | ||
47 | } | ||
48 | |||
49 | return absoluteAPIUrl | ||
50 | } | ||
51 | |||
41 | export { | 52 | export { |
42 | viewportHeight, | 53 | viewportHeight, |
43 | getParameterByName, | 54 | getParameterByName, |
44 | populateAsyncUserVideoChannels | 55 | populateAsyncUserVideoChannels, |
56 | getAbsoluteAPIUrl | ||
45 | } | 57 | } |