1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-18 01:03:35 +00:00

show toasts on copying, resolves #28

This commit is contained in:
Kyle Spearrin
2018-02-23 16:31:52 -05:00
parent accb4436ba
commit e24a083936
6 changed files with 53 additions and 28 deletions

View File

@@ -12,6 +12,7 @@ import {
} from '@angular/core';
import { PasswordGenerationService } from 'jslib/abstractions/passwordGeneration.service';
import { I18nService } from 'jslib/abstractions/i18n.service';
import { PlatformUtilsService } from 'jslib/abstractions/platformUtils.service';
@Component({
@@ -28,7 +29,8 @@ export class PasswordGeneratorComponent implements OnInit {
avoidAmbiguous = false;
constructor(private passwordGenerationService: PasswordGenerationService, private analytics: Angulartics2,
private platformUtilsService: PlatformUtilsService) { }
private platformUtilsService: PlatformUtilsService, private i18nService: I18nService,
private toasterService: ToasterService) { }
async ngOnInit() {
this.options = await this.passwordGenerationService.getOptions();
@@ -73,6 +75,7 @@ export class PasswordGeneratorComponent implements OnInit {
copy() {
this.analytics.eventTrack.next({ action: 'Copied Generated Password' });
this.platformUtilsService.copyToClipboard(this.password);
this.toasterService.popAsync('info', null, this.i18nService.t('valueCopied', this.i18nService.t('password')));
}
select() {