1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-17 08:43:33 +00:00

move getDomain to jslib Utils

This commit is contained in:
Kyle Spearrin
2018-10-13 22:21:54 -04:00
parent c35576deb8
commit ad97afc590
9 changed files with 94 additions and 29 deletions

View File

@@ -4,8 +4,6 @@ import { View } from './view';
import { LoginUri } from '../domain/loginUri';
import { PlatformUtilsService } from '../../abstractions/platformUtils.service';
import { Utils } from '../../misc/utils';
export class LoginUriView implements View {
@@ -35,15 +33,9 @@ export class LoginUriView implements View {
get domain(): string {
if (this._domain == null && this.uri != null) {
const containerService = (Utils.global as any).bitwardenContainerService;
if (containerService) {
const platformUtilsService: PlatformUtilsService = containerService.getPlatformUtilsService();
this._domain = platformUtilsService.getDomain(this.uri);
if (this._domain === '') {
this._domain = null;
}
} else {
throw new Error('global bitwardenContainerService not initialized.');
this._domain = Utils.getDomain(this.uri);
if (this._domain === '') {
this._domain = null;
}
}