1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-20 18:23:31 +00:00

interfaced utilsservice for popup and dependencies

This commit is contained in:
Kyle Spearrin
2017-11-13 15:37:38 -05:00
parent 907247b3a7
commit 11f392b036
13 changed files with 98 additions and 59 deletions

View File

@@ -11,7 +11,7 @@ import { Identity } from './identity';
import { Login } from './login';
import { SecureNote } from './secureNote';
import UtilsService from '../../services/utils.service';
import { UtilsService } from '../../services/abstractions/utils.service';
class Cipher extends Domain {
id: string;
@@ -31,6 +31,8 @@ class Cipher extends Domain {
attachments: Attachment[];
fields: Field[];
private utilsService: UtilsService;
constructor(obj?: CipherData, alreadyEncrypted: boolean = false, localData: any = null) {
super();
if (obj == null) {
@@ -113,7 +115,11 @@ class Cipher extends Domain {
model.login = await this.login.decrypt(this.organizationId);
model.subTitle = model.login.username;
if (model.login.uri) {
model.login.domain = UtilsService.getDomain(model.login.uri);
if (this.utilsService == null) {
this.utilsService = chrome.extension.getBackgroundPage().bg_utilsService as UtilsService;
}
model.login.domain = this.utilsService.getDomain(model.login.uri);
}
break;
case CipherType.SecureNote: