diff options
Diffstat (limited to 'client/src/app/shared/shared-main')
-rw-r--r-- | client/src/app/shared/shared-main/account/actor.model.ts | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/client/src/app/shared/shared-main/account/actor.model.ts b/client/src/app/shared/shared-main/account/actor.model.ts index a54f51aa4..bd693860d 100644 --- a/client/src/app/shared/shared-main/account/actor.model.ts +++ b/client/src/app/shared/shared-main/account/actor.model.ts | |||
@@ -1,4 +1,4 @@ | |||
1 | import { getAbsoluteAPIUrl } from '@app/helpers' | 1 | import { getAbsoluteAPIUrl, getAPIHost } from '@app/helpers' |
2 | import { Actor as ServerActor, ActorImage } from '@shared/models' | 2 | import { Actor as ServerActor, ActorImage } from '@shared/models' |
3 | 3 | ||
4 | export abstract class Actor implements ServerActor { | 4 | export abstract class Actor implements ServerActor { |
@@ -32,8 +32,7 @@ export abstract class Actor implements ServerActor { | |||
32 | } | 32 | } |
33 | 33 | ||
34 | static CREATE_BY_STRING (accountName: string, host: string, forceHostname = false) { | 34 | static CREATE_BY_STRING (accountName: string, host: string, forceHostname = false) { |
35 | const absoluteAPIUrl = getAbsoluteAPIUrl() | 35 | const thisHost = getAPIHost() |
36 | const thisHost = new URL(absoluteAPIUrl).host | ||
37 | 36 | ||
38 | if (host.trim() === thisHost && !forceHostname) return accountName | 37 | if (host.trim() === thisHost && !forceHostname) return accountName |
39 | 38 | ||
@@ -41,8 +40,7 @@ export abstract class Actor implements ServerActor { | |||
41 | } | 40 | } |
42 | 41 | ||
43 | static IS_LOCAL (host: string) { | 42 | static IS_LOCAL (host: string) { |
44 | const absoluteAPIUrl = getAbsoluteAPIUrl() | 43 | const thisHost = getAPIHost() |
45 | const thisHost = new URL(absoluteAPIUrl).host | ||
46 | 44 | ||
47 | return host.trim() === thisHost | 45 | return host.trim() === thisHost |
48 | } | 46 | } |