mirror of
https://github.com/bitwarden/browser
synced 2025-12-17 08:43:33 +00:00
clear clipboard setting
This commit is contained in:
@@ -34,6 +34,8 @@ export class OptionsComponent implements OnInit {
|
||||
themeOptions: any[];
|
||||
defaultUriMatch = UriMatchType.Domain;
|
||||
uriMatchOptions: any[];
|
||||
clearClipboard: number;
|
||||
clearClipboardOptions: any[];
|
||||
|
||||
constructor(private analytics: Angulartics2, private messagingService: MessagingService,
|
||||
private platformUtilsService: PlatformUtilsService, private storageService: StorageService,
|
||||
@@ -52,6 +54,15 @@ export class OptionsComponent implements OnInit {
|
||||
{ name: i18nService.t('exact'), value: UriMatchType.Exact },
|
||||
{ name: i18nService.t('never'), value: UriMatchType.Never },
|
||||
];
|
||||
this.clearClipboardOptions = [
|
||||
{ name: i18nService.t('never'), value: null },
|
||||
{ name: i18nService.t('tenSeconds'), value: 10 },
|
||||
{ name: i18nService.t('twentySeconds'), value: 20 },
|
||||
{ name: i18nService.t('thirtySeconds'), value: 30 },
|
||||
{ name: i18nService.t('oneMinute'), value: 60 },
|
||||
{ name: i18nService.t('twoMinutes'), value: 120 },
|
||||
{ name: i18nService.t('fiveMinutes'), value: 300 },
|
||||
];
|
||||
}
|
||||
|
||||
async ngOnInit() {
|
||||
@@ -80,6 +91,8 @@ export class OptionsComponent implements OnInit {
|
||||
|
||||
const defaultUriMatch = await this.storageService.get<UriMatchType>(ConstantsService.defaultUriMatch);
|
||||
this.defaultUriMatch = defaultUriMatch == null ? UriMatchType.Domain : defaultUriMatch;
|
||||
|
||||
this.clearClipboard = await this.storageService.get<number>(ConstantsService.clearClipboardKey);
|
||||
}
|
||||
|
||||
async updateAddLoginNotification() {
|
||||
@@ -140,6 +153,13 @@ export class OptionsComponent implements OnInit {
|
||||
this.analytics.eventTrack.next({ action: 'Set Default URI Match ' + this.defaultUriMatch });
|
||||
}
|
||||
|
||||
async saveClearClipboard() {
|
||||
await this.storageService.save(ConstantsService.clearClipboardKey, this.clearClipboard);
|
||||
this.analytics.eventTrack.next({
|
||||
action: 'Set Clear Clipboard ' + (this.clearClipboard == null ? 'disabled' : this.clearClipboard),
|
||||
});
|
||||
}
|
||||
|
||||
private callAnalytics(name: string, enabled: boolean) {
|
||||
const status = enabled ? 'Enabled' : 'Disabled';
|
||||
this.analytics.eventTrack.next({ action: `${status} ${name}` });
|
||||
|
||||
Reference in New Issue
Block a user