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

move eventTrack analytics to platform utils

This commit is contained in:
Kyle Spearrin
2018-10-03 00:03:49 -04:00
parent f793ff0aa5
commit ad31527b8d
20 changed files with 52 additions and 104 deletions

View File

@@ -1,5 +1,3 @@
import { Angulartics2 } from 'angulartics2';
import { OnInit } from '@angular/core';
import { CipherService } from '../../abstractions/cipher.service';
@@ -12,9 +10,8 @@ export class PasswordHistoryComponent implements OnInit {
cipherId: string;
history: PasswordHistoryView[] = [];
constructor(protected cipherService: CipherService, protected analytics: Angulartics2,
protected platformUtilsService: PlatformUtilsService, protected i18nService: I18nService,
private win: Window) { }
constructor(protected cipherService: CipherService, protected platformUtilsService: PlatformUtilsService,
protected i18nService: I18nService, private win: Window) { }
async ngOnInit() {
const cipher = await this.cipherService.get(this.cipherId);
@@ -23,7 +20,7 @@ export class PasswordHistoryComponent implements OnInit {
}
copy(password: string) {
this.analytics.eventTrack.next({ action: 'Copied Password History' });
this.platformUtilsService.eventTrack('Copied Password History');
const copyOptions = this.win != null ? { window: this.win } : null;
this.platformUtilsService.copyToClipboard(password, copyOptions);
this.platformUtilsService.showToast('info', null,