Skip to content

Commit

Permalink
fix broken blockedInteractionsUris state contruction
Browse files Browse the repository at this point in the history
  • Loading branch information
jprusik committed Jan 10, 2025
1 parent 3c99493 commit ac7525a
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ describe("DefaultDomainSettingsService", () => {

jest.spyOn(domainSettingsService, "getUrlEquivalentDomains");
domainSettingsService.equivalentDomains$ = of(mockEquivalentDomains);
domainSettingsService.blockedInteractionsUris$ = of(null);
domainSettingsService.blockedInteractionsUris$ = of({});
});

describe("getUrlEquivalentDomains", () => {
Expand Down
4 changes: 2 additions & 2 deletions libs/common/src/autofill/services/domain-settings.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ const BLOCKED_INTERACTIONS_URIS = new KeyDefinition(
DOMAIN_SETTINGS_DISK,
"blockedInteractionsUris",
{
deserializer: (value: NeverDomains) => value ?? null,
deserializer: (value: NeverDomains) => value ?? {},
},
);

Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit ac7525a

Please sign in to comment.