1
0
mirror of https://github.com/bitwarden/browser.git synced 2024-09-18 02:41:15 +02:00

hostname or uri

This commit is contained in:
Kyle Spearrin 2018-04-19 14:40:42 -04:00
parent fae4530564
commit 8cf3a6b0f0

View File

@ -6,12 +6,15 @@ import { LoginUri } from '../domain/loginUri';
import { PlatformUtilsService } from '../../abstractions/platformUtils.service';
import { UtilsService } from '../../services/utils.service';
export class LoginUriView implements View {
match: UriMatchType = null;
// tslint:disable
private _uri: string;
private _domain: string;
private _hostname: string;
// tslint:enable
constructor(u?: LoginUri) {
@ -47,8 +50,19 @@ export class LoginUriView implements View {
return this._domain;
}
get domainOrUri(): string {
return this.domain != null ? this.domain : this.uri;
get hostname(): string {
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 {