mirror of
https://github.com/bitwarden/browser
synced 2025-12-17 16:53:34 +00:00
Add minimize when copying to clipboard option (#390)
* Add minimize when copying to clipboard option * Change minimizeOnCopyToClipboardKey constant reference and fix whitespace * Extend feature to context menus and view component * Cleanup and refactor methods * Refactor copy method and add minimizeOnCopyToClipboardKey constant to electronConstants.ts * Use window.main subclass and fix formatting * Revert "Use window.main subclass and fix formatting" This reverts commit 0159613751a54bc886fac0b34bd09d3a26498924. * Reimplement part of 0159613751a54bc886fac0b34bd09d3a26498924 * Add null check to VaultComponent::copyValue * Remove unused import
This commit is contained in:
committed by
GitHub
parent
0faa987f41
commit
a84af15c93
@@ -38,6 +38,7 @@ export class SettingsComponent implements OnInit {
|
||||
enableTray: boolean = false;
|
||||
showMinToTray: boolean = false;
|
||||
startToTray: boolean = false;
|
||||
minimizeOnCopyToClipboard: boolean = false;
|
||||
locale: string;
|
||||
vaultTimeouts: any[];
|
||||
localeOptions: any[];
|
||||
@@ -122,6 +123,8 @@ export class SettingsComponent implements OnInit {
|
||||
this.locale = await this.storageService.get<string>(ConstantsService.localeKey);
|
||||
this.theme = await this.storageService.get<string>(ConstantsService.themeKey);
|
||||
this.clearClipboard = await this.storageService.get<number>(ConstantsService.clearClipboardKey);
|
||||
this.minimizeOnCopyToClipboard = await this.storageService.get<boolean>(
|
||||
ElectronConstants.minimizeOnCopyToClipboardKey);
|
||||
}
|
||||
|
||||
async saveVaultTimeoutOptions() {
|
||||
@@ -227,6 +230,11 @@ export class SettingsComponent implements OnInit {
|
||||
window.setTimeout(() => window.location.reload(), 200);
|
||||
}
|
||||
|
||||
async saveMinOnCopyToClipboard() {
|
||||
await this.storageService.save(ElectronConstants.minimizeOnCopyToClipboardKey, this.minimizeOnCopyToClipboard);
|
||||
this.callAnalytics('MinOnCopyToClipboard', this.minimizeOnCopyToClipboard);
|
||||
}
|
||||
|
||||
async saveClearClipboard() {
|
||||
await this.storageService.save(ConstantsService.clearClipboardKey, this.clearClipboard);
|
||||
this.analytics.eventTrack.next({
|
||||
|
||||
Reference in New Issue
Block a user