diff options
author | Nassim Bounouas <NassimBounouas@users.noreply.github.com> | 2019-06-19 14:57:39 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2019-06-19 14:57:39 +0200 |
commit | e379f813d45c4a83442aa13268d351e2605a7a01 (patch) | |
tree | c912ae77b981574c2e859bc5740ca2180f61f9b6 /client/src/app/shared/actor | |
parent | b6a1dd4d1b3b0032f8b968e72cbd074f646e8827 (diff) | |
download | PeerTube-e379f813d45c4a83442aa13268d351e2605a7a01.tar.gz PeerTube-e379f813d45c4a83442aa13268d351e2605a7a01.tar.zst PeerTube-e379f813d45c4a83442aa13268d351e2605a7a01.zip |
Feature/completeUsernameCopy (#1913)
* #1843 Copy icon added to account page to copy Username
* #1843 Store an account name with the host forced and bind it to copy button
* #1843 tslint correction
* #1843 copy to clipboard replaced by ngx-clipboard
Diffstat (limited to 'client/src/app/shared/actor')
-rw-r--r-- | client/src/app/shared/actor/actor.model.ts | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/client/src/app/shared/actor/actor.model.ts b/client/src/app/shared/actor/actor.model.ts index 5a517c975..285f71ce0 100644 --- a/client/src/app/shared/actor/actor.model.ts +++ b/client/src/app/shared/actor/actor.model.ts | |||
@@ -23,11 +23,11 @@ export abstract class Actor implements ActorServer { | |||
23 | return window.location.origin + '/client/assets/images/default-avatar.png' | 23 | return window.location.origin + '/client/assets/images/default-avatar.png' |
24 | } | 24 | } |
25 | 25 | ||
26 | static CREATE_BY_STRING (accountName: string, host: string) { | 26 | static CREATE_BY_STRING (accountName: string, host: string, forceHostname = false) { |
27 | const absoluteAPIUrl = getAbsoluteAPIUrl() | 27 | const absoluteAPIUrl = getAbsoluteAPIUrl() |
28 | const thisHost = new URL(absoluteAPIUrl).host | 28 | const thisHost = new URL(absoluteAPIUrl).host |
29 | 29 | ||
30 | if (host.trim() === thisHost) return accountName | 30 | if (host.trim() === thisHost && !forceHostname) return accountName |
31 | 31 | ||
32 | return accountName + '@' + host | 32 | return accountName + '@' + host |
33 | } | 33 | } |