aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/shared/account
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2018-01-08 10:35:54 +0100
committerChocobozzz <me@florianbigard.com>2018-01-08 10:35:54 +0100
commit76d36e0b355f41fb46709ba5e39c59b10087c6a9 (patch)
tree7a88cb3f071c458d032cf11943dec40510d3622b /client/src/app/shared/account
parent93ef8a9d02059da2fc90efedb7755c97e9e19ef4 (diff)
downloadPeerTube-76d36e0b355f41fb46709ba5e39c59b10087c6a9.tar.gz
PeerTube-76d36e0b355f41fb46709ba5e39c59b10087c6a9.tar.zst
PeerTube-76d36e0b355f41fb46709ba5e39c59b10087c6a9.zip
Refractor account by
Diffstat (limited to 'client/src/app/shared/account')
-rw-r--r--client/src/app/shared/account/account.model.ts9
1 files changed, 9 insertions, 0 deletions
diff --git a/client/src/app/shared/account/account.model.ts b/client/src/app/shared/account/account.model.ts
index 1dce0003c..dffca783b 100644
--- a/client/src/app/shared/account/account.model.ts
+++ b/client/src/app/shared/account/account.model.ts
@@ -22,4 +22,13 @@ export class Account implements ServerAccount {
22 22
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
26 static CREATE_BY_STRING (accountName: string, host: string) {
27 const absoluteAPIUrl = getAbsoluteAPIUrl()
28 const thisHost = new URL(absoluteAPIUrl).host
29
30 if (host.trim() === thisHost) return accountName
31
32 return accountName + '@' + host
33 }
25} 34}