From fd9455873d161c2ddca9637d8302124b318a4c12 Mon Sep 17 00:00:00 2001 From: Daniel James Smith Date: Wed, 20 Oct 2021 17:45:19 +0200 Subject: [PATCH] Add literal for noopCommand suffix --- src/background/contextMenus.background.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/background/contextMenus.background.ts b/src/background/contextMenus.background.ts index 609081b2b72..f4b310e809e 100644 --- a/src/background/contextMenus.background.ts +++ b/src/background/contextMenus.background.ts @@ -14,6 +14,7 @@ import { CipherView } from 'jslib-common/models/view/cipherView'; import LockedVaultPendingNotificationsItem from './models/lockedVaultPendingNotificationsItem'; export default class ContextMenusBackground { + private readonly noopCommandSuffix = 'noop'; private contextMenus: any; constructor(private main: MainBackground, private cipherService: CipherService, @@ -69,7 +70,7 @@ export default class ContextMenusBackground { if (await this.vaultTimeoutService.isLocked()) { const retryMessage: LockedVaultPendingNotificationsItem = { commandToRetry: { - msg: { command: 'noop', data: info }, + msg: { command: this.noopCommandSuffix, data: info }, sender: { tab: tab }, }, target: 'contextmenus.background', @@ -81,7 +82,7 @@ export default class ContextMenusBackground { } let cipher: CipherView; - if (id === 'noop') { + if (id === this.noopCommandSuffix) { const ciphers = await this.cipherService.getAllDecryptedForUrl(tab.url); cipher = ciphers.length > 0 ? ciphers[0] : null; }