1
0
mirror of https://github.com/bitwarden/browser.git synced 2024-11-03 08:49:50 +01:00

use this on generator

This commit is contained in:
Kyle Spearrin 2018-04-10 09:38:21 -04:00
parent 5d6c206de0
commit e4a50cbbb0
3 changed files with 8 additions and 9 deletions

View File

@ -1,6 +1,6 @@
<header>
<div class="left">
<button type="button" appBlurClick (click)="close()">{{'close' | i18n}}</button>
<button type="button" appBlurClick (click)="close()">{{closeText}}</button>
</div>
<div class="center">
<span class="title">{{'passGen' | i18n}}</span>

View File

@ -2,12 +2,8 @@ import { ToasterService } from 'angular2-toaster';
import { Angulartics2 } from 'angulartics2';
import { Location } from '@angular/common';
import {
Component,
} from '@angular/core';
import {
Router,
} from '@angular/router';
import { Component } from '@angular/core';
import { Router } from '@angular/router';
import { I18nService } from 'jslib/abstractions/i18n.service';
import { PasswordGenerationService } from 'jslib/abstractions/passwordGeneration.service';
@ -25,6 +21,8 @@ import {
templateUrl: 'password-generator.component.html',
})
export class PasswordGeneratorComponent extends BasePasswordGeneratorComponent {
closeText: string;
private cipherState: CipherView;
constructor(passwordGenerationService: PasswordGenerationService, analytics: Angulartics2,
@ -37,7 +35,8 @@ export class PasswordGeneratorComponent extends BasePasswordGeneratorComponent {
async ngOnInit() {
await super.ngOnInit();
this.cipherState = await this.stateService.get<CipherView>('addEditCipher');
super.showSelect = this.cipherState != null;
this.showSelect = this.cipherState != null;
this.closeText = this.showSelect ? this.i18nService.t('cancel') : this.i18nService.t('close');
}
select() {

View File

@ -31,7 +31,7 @@
(onSelected)="fillCipher($event)" (onView)="viewCipher($event)"
*ngIf="loginCiphers.length"></app-ciphers-list>
<div class="box-content-row text-center padded no-hover" *ngIf="!loginCiphers.length">
{{'autoFillInfo' | i18n}}
<p>{{'autoFillInfo' | i18n}}</p>
<button type="button" class="btn primary link block" (click)="addCipher()">
{{'addLogin' | i18n}}
</button>