From 1eaa10418256e3e5ff2490d15a90d1b1225f63d8 Mon Sep 17 00:00:00 2001 From: Kyle Spearrin Date: Fri, 16 Feb 2018 14:15:35 -0500 Subject: [PATCH] convert copying to platform utils service --- src/app/vault/password-generator.component.ts | 6 +++--- src/app/vault/view.component.ts | 8 +++----- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/src/app/vault/password-generator.component.ts b/src/app/vault/password-generator.component.ts index 2bfa157c..ef114525 100644 --- a/src/app/vault/password-generator.component.ts +++ b/src/app/vault/password-generator.component.ts @@ -12,7 +12,7 @@ import { } from '@angular/core'; import { PasswordGenerationService } from 'jslib/abstractions/passwordGeneration.service'; -import { UtilsService } from 'jslib/abstractions/utils.service'; +import { PlatformUtilsService } from 'jslib/abstractions/platformUtils.service'; @Component({ selector: 'password-generator', @@ -28,7 +28,7 @@ export class PasswordGeneratorComponent implements OnInit { avoidAmbiguous = false; constructor(private passwordGenerationService: PasswordGenerationService, private analytics: Angulartics2, - private utilsService: UtilsService) { } + private platformUtilsService: PlatformUtilsService) { } async ngOnInit() { this.options = await this.passwordGenerationService.getOptions(); @@ -73,7 +73,7 @@ export class PasswordGeneratorComponent implements OnInit { copy() { this.analytics.eventTrack.next({ action: 'Copied Generated Password' }); - this.utilsService.copyToClipboard(this.password, window.document); + this.platformUtilsService.copyToClipboard(this.password); } select() { diff --git a/src/app/vault/view.component.ts b/src/app/vault/view.component.ts index 6eccee71..3867420c 100644 --- a/src/app/vault/view.component.ts +++ b/src/app/vault/view.component.ts @@ -21,7 +21,6 @@ import { I18nService } from 'jslib/abstractions/i18n.service'; import { PlatformUtilsService } from 'jslib/abstractions/platformUtils.service'; import { TokenService } from 'jslib/abstractions/token.service'; import { TotpService } from 'jslib/abstractions/totp.service'; -import { UtilsService } from 'jslib/abstractions/utils.service'; import { AttachmentView } from 'jslib/models/view/attachmentView'; import { CipherView } from 'jslib/models/view/cipherView'; @@ -47,10 +46,9 @@ export class ViewComponent implements OnChanges, OnDestroy { private totpInterval: any; constructor(private cipherService: CipherService, private totpService: TotpService, - private tokenService: TokenService, private utilsService: UtilsService, + private tokenService: TokenService, private toasterService: ToasterService, private cryptoService: CryptoService, private platformUtilsService: PlatformUtilsService, - private i18nService: I18nService, private analytics: Angulartics2, private toasterService: ToasterService) { - } + private i18nService: I18nService, private analytics: Angulartics2) { } async ngOnChanges() { this.cleanUp(); @@ -104,7 +102,7 @@ export class ViewComponent implements OnChanges, OnDestroy { } this.analytics.eventTrack.next({ action: 'Copied ' + aType }); - this.utilsService.copyToClipboard(value, window.document); + this.platformUtilsService.copyToClipboard(value); } async downloadAttachment(attachment: AttachmentView) {