From af61732800624284dfc023c124e99757c49965cf Mon Sep 17 00:00:00 2001 From: Thomas Rittson Date: Fri, 14 May 2021 10:04:08 +1000 Subject: [PATCH] Copy TOTP after all autofills, remove old UI --- src/_locales/en/messages.json | 6 ------ src/popup/settings/options.component.html | 12 ------------ src/popup/settings/options.component.ts | 8 -------- src/services/autofill.service.ts | 5 +---- 4 files changed, 1 insertion(+), 30 deletions(-) diff --git a/src/_locales/en/messages.json b/src/_locales/en/messages.json index 3b5121d7f5..44d98f4cc8 100644 --- a/src/_locales/en/messages.json +++ b/src/_locales/en/messages.json @@ -898,12 +898,6 @@ "enableAutoFillOnPageLoadDesc": { "message": "If a login form is detected, automatically perform an auto-fill when the web page loads." }, - "enableAutoTotpCopyOnAutoFill": { - "message": "Automatic TOTP Copy after Page Load" - }, - "enableAutoTotpCopyOnAutoFillDesc": { - "message": "If Auto-fill On Page Load is enabled, the TOTP verification code is automatically copied to your clipboard after loading the web page. This is overridden by Disable Automatic TOTP Copy." - }, "experimentalFeature": { "message": "This is currently an experimental feature. Use at your own risk." }, diff --git a/src/popup/settings/options.component.html b/src/popup/settings/options.component.html index fd7563a12d..83bbc329a6 100644 --- a/src/popup/settings/options.component.html +++ b/src/popup/settings/options.component.html @@ -161,17 +161,5 @@ {{'warning' | i18n}}: {{'experimentalFeature' | i18n}} -
-
-
- - -
-
- -
diff --git a/src/popup/settings/options.component.ts b/src/popup/settings/options.component.ts index 355e47a328..60db20ae73 100644 --- a/src/popup/settings/options.component.ts +++ b/src/popup/settings/options.component.ts @@ -7,7 +7,6 @@ import { UriMatchType } from 'jslib/enums/uriMatchType'; import { I18nService } from 'jslib/abstractions/i18n.service'; import { MessagingService } from 'jslib/abstractions/messaging.service'; -import { PlatformUtilsService } from 'jslib/abstractions/platformUtils.service'; import { StateService } from 'jslib/abstractions/state.service'; import { StorageService } from 'jslib/abstractions/storage.service'; import { TotpService } from 'jslib/abstractions/totp.service'; @@ -22,7 +21,6 @@ export class OptionsComponent implements OnInit { disableFavicon = false; disableBadgeCounter = false; enableAutoFillOnPageLoad = false; - enableAutoTotpCopyOnAutoFill = false; disableAutoTotpCopy = false; disableContextMenuItem = false; disableAddLoginNotification = false; @@ -72,8 +70,6 @@ export class OptionsComponent implements OnInit { this.enableAutoFillOnPageLoad = await this.storageService.get( ConstantsService.enableAutoFillOnPageLoadKey); - this.enableAutoTotpCopyOnAutoFill = await this.totpService.isAutoCopyOnAutoFillEnabled(); - this.disableAddLoginNotification = await this.storageService.get( ConstantsService.disableAddLoginNotificationKey); @@ -124,10 +120,6 @@ export class OptionsComponent implements OnInit { await this.storageService.save(ConstantsService.enableAutoFillOnPageLoadKey, this.enableAutoFillOnPageLoad); } - async updateAutoTotpCopyOnAutoFill() { - await this.storageService.save(ConstantsService.enableAutoTotpCopyOnAutoFillKey, this.enableAutoTotpCopyOnAutoFill); - } - async updateDisableFavicon() { await this.storageService.save(ConstantsService.disableFaviconKey, this.disableFavicon); await this.stateService.save(ConstantsService.disableFaviconKey, this.disableFavicon); diff --git a/src/services/autofill.service.ts b/src/services/autofill.service.ts index 08f7b41a2a..e73d7e2708 100644 --- a/src/services/autofill.service.ts +++ b/src/services/autofill.service.ts @@ -259,13 +259,10 @@ export default class AutofillService implements AutofillServiceInterface { return; } - const copyTotpOnAutoFill = await this.totpService.isAutoCopyOnAutoFillEnabled(); - const shouldCopyTotp = fromCommand || copyTotpOnAutoFill; - const totpCode = await this.doAutoFill({ cipher: cipher, pageDetails: pageDetails, - skipTotp: !shouldCopyTotp, + skipTotp: false, skipLastUsed: !fromCommand, skipUsernameOnlyFill: !fromCommand, onlyEmptyFields: !fromCommand,