1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-16 16:23:44 +00:00

Add literal for noopCommand suffix

This commit is contained in:
Daniel James Smith
2021-10-20 17:45:19 +02:00
parent ec13cfd70c
commit fd9455873d

View File

@@ -14,6 +14,7 @@ import { CipherView } from 'jslib-common/models/view/cipherView';
import LockedVaultPendingNotificationsItem from './models/lockedVaultPendingNotificationsItem'; import LockedVaultPendingNotificationsItem from './models/lockedVaultPendingNotificationsItem';
export default class ContextMenusBackground { export default class ContextMenusBackground {
private readonly noopCommandSuffix = 'noop';
private contextMenus: any; private contextMenus: any;
constructor(private main: MainBackground, private cipherService: CipherService, constructor(private main: MainBackground, private cipherService: CipherService,
@@ -69,7 +70,7 @@ export default class ContextMenusBackground {
if (await this.vaultTimeoutService.isLocked()) { if (await this.vaultTimeoutService.isLocked()) {
const retryMessage: LockedVaultPendingNotificationsItem = { const retryMessage: LockedVaultPendingNotificationsItem = {
commandToRetry: { commandToRetry: {
msg: { command: 'noop', data: info }, msg: { command: this.noopCommandSuffix, data: info },
sender: { tab: tab }, sender: { tab: tab },
}, },
target: 'contextmenus.background', target: 'contextmenus.background',
@@ -81,7 +82,7 @@ export default class ContextMenusBackground {
} }
let cipher: CipherView; let cipher: CipherView;
if (id === 'noop') { if (id === this.noopCommandSuffix) {
const ciphers = await this.cipherService.getAllDecryptedForUrl(tab.url); const ciphers = await this.cipherService.getAllDecryptedForUrl(tab.url);
cipher = ciphers.length > 0 ? ciphers[0] : null; cipher = ciphers.length > 0 ? ciphers[0] : null;
} }