diff --git a/jslib b/jslib index cd46f64993..38fc0432c3 160000 --- a/jslib +++ b/jslib @@ -1 +1 @@ -Subproject commit cd46f64993545a1cb772e2f6a2137a675554f3c3 +Subproject commit 38fc0432c3b352628b0114ac98b49ca69ee01675 diff --git a/src/popup/settings/options.component.ts b/src/popup/settings/options.component.ts index 072d04bc35..de3bc0f40e 100644 --- a/src/popup/settings/options.component.ts +++ b/src/popup/settings/options.component.ts @@ -84,7 +84,7 @@ export class OptionsComponent implements OnInit { this.dontShowCards = await this.storageService.get(ConstantsService.dontShowCardsCurrentTab); this.dontShowIdentities = await this.storageService.get(ConstantsService.dontShowIdentitiesCurrentTab); - this.disableAutoTotpCopy = !await this.totpService.isAutoCopyEnabled(); + this.disableAutoTotpCopy = !(await this.totpService.isAutoCopyEnabled()); this.disableFavicon = await this.storageService.get(ConstantsService.disableFaviconKey); diff --git a/src/services/browserPlatformUtils.service.ts b/src/services/browserPlatformUtils.service.ts index 9ae66fd114..4d35f7da03 100644 --- a/src/services/browserPlatformUtils.service.ts +++ b/src/services/browserPlatformUtils.service.ts @@ -186,17 +186,18 @@ export default class BrowserPlatformUtilsService implements PlatformUtilsService } else if (options && options.doc) { doc = options.doc; } + const clearing = options ? !!options.clearing : false; const clearMs: number = options && options.clearMs ? options.clearMs : null; if (this.isFirefox() && (win as any).navigator.clipboard && (win as any).navigator.clipboard.writeText) { (win as any).navigator.clipboard.writeText(text).then(() => { - if (this.clipboardWriteCallback != null) { + if (!clearing && this.clipboardWriteCallback != null) { this.clipboardWriteCallback(text, clearMs); } }); } else if ((win as any).clipboardData && (win as any).clipboardData.setData) { // IE specific code path to prevent textarea being shown while dialog is visible. (win as any).clipboardData.setData('Text', text); - if (this.clipboardWriteCallback != null) { + if (!clearing && this.clipboardWriteCallback != null) { this.clipboardWriteCallback(text, clearMs); } } else if (doc.queryCommandSupported && doc.queryCommandSupported('copy')) { @@ -209,7 +210,7 @@ export default class BrowserPlatformUtilsService implements PlatformUtilsService try { // Security exception may be thrown by some browsers. - if (doc.execCommand('copy') && this.clipboardWriteCallback != null) { + if (doc.execCommand('copy') && !clearing && this.clipboardWriteCallback != null) { this.clipboardWriteCallback(text, clearMs); } } catch (e) {