diff options
author | Chocobozzz <me@florianbigard.com> | 2017-12-29 19:10:13 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2017-12-29 19:10:13 +0100 |
commit | c5911fd347c76e8bdc05ea9f3ee9efed4a58c236 (patch) | |
tree | b8d287daca6c45305090cbec9da97d1155f275bd /client/src/app/shared/misc | |
parent | 8b0d42ee372de6589796be26b83e5bffb1b69cdf (diff) | |
download | PeerTube-c5911fd347c76e8bdc05ea9f3ee9efed4a58c236.tar.gz PeerTube-c5911fd347c76e8bdc05ea9f3ee9efed4a58c236.tar.zst PeerTube-c5911fd347c76e8bdc05ea9f3ee9efed4a58c236.zip |
Begin to add avatar to actors
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 | } |