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:
@@ -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');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -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');
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user