mirror of
https://github.com/bitwarden/browser
synced 2025-12-16 08:13:42 +00:00
dont attempt certain bg tasks when locked state
This commit is contained in:
@@ -1,15 +1,14 @@
|
||||
import {
|
||||
CipherService,
|
||||
PlatformUtilsService,
|
||||
} from 'jslib/abstractions';
|
||||
import { CipherService } from 'jslib/abstractions/cipher.service';
|
||||
import { LockService } from 'jslib/abstractions/lock.service';
|
||||
import { PlatformUtilsService } from 'jslib/abstractions/platformUtils.service';
|
||||
|
||||
export default class WebRequestBackground {
|
||||
private pendingAuthRequests: any[] = [];
|
||||
private webRequest: any;
|
||||
private isFirefox: boolean;
|
||||
|
||||
constructor(private platformUtilsService: PlatformUtilsService,
|
||||
private cipherService: CipherService) {
|
||||
constructor(platformUtilsService: PlatformUtilsService, private cipherService: CipherService,
|
||||
private lockService: LockService) {
|
||||
this.webRequest = (window as any).chrome.webRequest;
|
||||
this.isFirefox = platformUtilsService.isFirefox();
|
||||
}
|
||||
@@ -45,6 +44,11 @@ export default class WebRequestBackground {
|
||||
}
|
||||
|
||||
private async resolveAuthCredentials(domain: string, success: Function, error: Function) {
|
||||
if (await this.lockService.isLocked()) {
|
||||
error();
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
const ciphers = await this.cipherService.getAllDecryptedForUrl(domain);
|
||||
if (ciphers == null || ciphers.length !== 1) {
|
||||
|
||||
Reference in New Issue
Block a user