mirror of
https://github.com/bitwarden/browser.git
synced 2025-02-17 01:31:25 +01:00
hostname or uri
This commit is contained in:
parent
fae4530564
commit
8cf3a6b0f0
@ -6,12 +6,15 @@ import { LoginUri } from '../domain/loginUri';
|
|||||||
|
|
||||||
import { PlatformUtilsService } from '../../abstractions/platformUtils.service';
|
import { PlatformUtilsService } from '../../abstractions/platformUtils.service';
|
||||||
|
|
||||||
|
import { UtilsService } from '../../services/utils.service';
|
||||||
|
|
||||||
export class LoginUriView implements View {
|
export class LoginUriView implements View {
|
||||||
match: UriMatchType = null;
|
match: UriMatchType = null;
|
||||||
|
|
||||||
// tslint:disable
|
// tslint:disable
|
||||||
private _uri: string;
|
private _uri: string;
|
||||||
private _domain: string;
|
private _domain: string;
|
||||||
|
private _hostname: string;
|
||||||
// tslint:enable
|
// tslint:enable
|
||||||
|
|
||||||
constructor(u?: LoginUri) {
|
constructor(u?: LoginUri) {
|
||||||
@ -47,8 +50,19 @@ export class LoginUriView implements View {
|
|||||||
return this._domain;
|
return this._domain;
|
||||||
}
|
}
|
||||||
|
|
||||||
get domainOrUri(): string {
|
get hostname(): string {
|
||||||
return this.domain != null ? this.domain : this.uri;
|
if (this._hostname == null && this.uri != null) {
|
||||||
|
this._hostname = UtilsService.getHostname(this.uri);
|
||||||
|
if (this._hostname === '') {
|
||||||
|
this._hostname = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return this._hostname;
|
||||||
|
}
|
||||||
|
|
||||||
|
get hostnameOrUri(): string {
|
||||||
|
return this.hostname != null ? this.hostname : this.uri;
|
||||||
}
|
}
|
||||||
|
|
||||||
get isWebsite(): boolean {
|
get isWebsite(): boolean {
|
||||||
|
Loading…
Reference in New Issue
Block a user