1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-21 02:33:46 +00:00

tweaks to minimize on copy feature (#432)

This commit is contained in:
Kyle Spearrin
2020-04-14 16:52:03 -04:00
committed by GitHub
parent a84af15c93
commit 848dff7863
7 changed files with 21 additions and 23 deletions

View File

@@ -660,8 +660,8 @@ export class VaultComponent implements OnInit, OnDestroy {
this.platformUtilsService.copyToClipboard(value);
this.toasterService.popAsync('info', null,
this.i18nService.t('valueCopied', this.i18nService.t(labelI18nKey)));
if (this.viewComponent != null && this.action === 'view') {
this.viewComponent.minimizeIfNeeded();
if (this.action === 'view') {
this.messagingService.send('minimizeOnCopy');
}
});
}

View File

@@ -25,8 +25,6 @@ import { ViewComponent as BaseViewComponent } from 'jslib/angular/components/vie
import { CipherView } from 'jslib/models/view/cipherView';
import { ElectronConstants } from 'jslib/electron/electronConstants';
@Component({
selector: 'app-vault-view',
templateUrl: 'view.component.html',
@@ -56,14 +54,6 @@ export class ViewComponent extends BaseViewComponent implements OnChanges {
copy(value: string, typeI18nKey: string, aType: string) {
super.copy(value, typeI18nKey, aType);
this.minimizeIfNeeded();
}
async minimizeIfNeeded(): Promise<void> {
const shouldMinimize = await this.storageService.get<boolean>(
ElectronConstants.minimizeOnCopyToClipboardKey);
if (shouldMinimize) {
this.messagingService.send('minimize');
}
this.messagingService.send('minimizeOnCopy');
}
}