1
0
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:
Jonathan Prusik 2025-01-13 09:01:16 -05:00 committed by GitHub
parent 22f4822efc
commit fb4d7e8f05
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 5 additions and 5 deletions

View File

@ -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,

View File

@ -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,

View File

@ -29,7 +29,7 @@ describe("DefaultDomainSettingsService", () => {
jest.spyOn(domainSettingsService, "getUrlEquivalentDomains");
domainSettingsService.equivalentDomains$ = of(mockEquivalentDomains);
domainSettingsService.blockedInteractionsUris$ = of(null);
domainSettingsService.blockedInteractionsUris$ = of({});
});
describe("getUrlEquivalentDomains", () => {

View File

@ -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);