1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-17 16:53:34 +00:00

lib updates for login view on desktop

This commit is contained in:
Kyle Spearrin
2018-01-24 23:27:04 -05:00
parent b4257b9ff3
commit e5c1adedff
6 changed files with 47 additions and 27 deletions

View File

@@ -57,4 +57,12 @@ export class CipherView implements View {
return null;
}
get hasAttachments(): boolean {
return this.attachments && this.attachments.length > 0;
}
get hasFields(): boolean {
return this.fields && this.fields.length > 0;
}
}

View File

@@ -53,7 +53,7 @@ export class LoginView implements View {
get maskedPassword(): string {
if (this._maskedPassword == null && this.password != null) {
this._maskedPassword = '';
for (var i = 0; i < this.password.length; i++) {
for (let i = 0; i < this.password.length; i++) {
this._maskedPassword += '•';
}
}
@@ -64,4 +64,16 @@ export class LoginView implements View {
get subTitle(): string {
return this.username;
}
get domainOrUri(): string {
return this.domain != null ? this.domain : this.uri;
}
get isWebsite(): boolean {
return this.uri != null && (this.uri.indexOf('http://') > -1 || this.uri.indexOf('https://') > -1);
}
get canLaunch(): boolean {
return this.uri != null && this.uri.indexOf('://') > -1;
}
}