mirror of
https://github.com/bitwarden/browser.git
synced 2025-01-14 20:01:31 +01:00
fix broken blockedInteractionsUris state contruction (#12813)
This commit is contained in:
parent
22f4822efc
commit
fb4d7e8f05
@ -63,7 +63,7 @@ describe("ScriptInjectorService", () => {
|
||||
configService.getFeatureFlag$.mockImplementation(() => of(false));
|
||||
domainSettingsService = new DefaultDomainSettingsService(fakeStateProvider, configService);
|
||||
domainSettingsService.equivalentDomains$ = of(mockEquivalentDomains);
|
||||
domainSettingsService.blockedInteractionsUris$ = of(null);
|
||||
domainSettingsService.blockedInteractionsUris$ = of({});
|
||||
scriptInjectorService = new BrowserScriptInjectorService(
|
||||
domainSettingsService,
|
||||
platformUtilsService,
|
||||
|
@ -39,7 +39,7 @@ describe("FilelessImporterBackground ", () => {
|
||||
let tabMock: chrome.tabs.Tab;
|
||||
|
||||
beforeEach(() => {
|
||||
domainSettingsService.blockedInteractionsUris$ = of(null);
|
||||
domainSettingsService.blockedInteractionsUris$ = of({});
|
||||
policyService.policyAppliesToActiveUser$.mockImplementation(() => of(true));
|
||||
scriptInjectorService = new BrowserScriptInjectorService(
|
||||
domainSettingsService,
|
||||
|
@ -29,7 +29,7 @@ describe("DefaultDomainSettingsService", () => {
|
||||
|
||||
jest.spyOn(domainSettingsService, "getUrlEquivalentDomains");
|
||||
domainSettingsService.equivalentDomains$ = of(mockEquivalentDomains);
|
||||
domainSettingsService.blockedInteractionsUris$ = of(null);
|
||||
domainSettingsService.blockedInteractionsUris$ = of({});
|
||||
});
|
||||
|
||||
describe("getUrlEquivalentDomains", () => {
|
||||
|
@ -36,7 +36,7 @@ const BLOCKED_INTERACTIONS_URIS = new KeyDefinition(
|
||||
DOMAIN_SETTINGS_DISK,
|
||||
"blockedInteractionsUris",
|
||||
{
|
||||
deserializer: (value: NeverDomains) => value ?? null,
|
||||
deserializer: (value: NeverDomains) => value ?? {},
|
||||
},
|
||||
);
|
||||
|
||||
@ -131,7 +131,7 @@ export class DefaultDomainSettingsService implements DomainSettingsService {
|
||||
switchMap((featureIsEnabled) =>
|
||||
featureIsEnabled ? this.blockedInteractionsUrisState.state$ : of({} as NeverDomains),
|
||||
),
|
||||
map((disabledUris) => (Object.keys(disabledUris).length ? disabledUris : null)),
|
||||
map((disabledUris) => (Object.keys(disabledUris).length ? disabledUris : {})),
|
||||
);
|
||||
|
||||
this.equivalentDomainsState = this.stateProvider.getActive(EQUIVALENT_DOMAINS);
|
||||
|
Loading…
Reference in New Issue
Block a user