Skip to content
This repository has been archived by the owner on Dec 9, 2024. It is now read-only.

Commit

Permalink
Merge pull request #742 from B77Mills/monorailBrowserIndex
Browse files Browse the repository at this point in the history
Correctly apply browser/index.js config overrides and fallback logic
  • Loading branch information
B77Mills authored Jul 20, 2023
2 parents 1b343f9 + 220311e commit a13e526
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions packages/marko-web-theme-monorail/browser/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,19 +28,25 @@ const setP1EventsIdentity = ({ p1events, brandKey, encryptedId }) => {
p1events('setIdentity', `omeda.${brandKey}.customer*${encryptedId}~encrypted`);
};

export default (Browser, config = {
const defaultConfig = {
enableOmedaIdentityX: true,
withGTM: true,
withP1Events: true,
idxArgs: {},
inquiryArgs: {},
}) => {
};

export default (Browser, configOverrides = {}) => {
const config = { ...defaultConfig, ...configOverrides };
const { EventBus } = Browser;
const { enableOmedaIdentityX } = config;
const {
enableOmedaIdentityX,
withP1Events,
} = config;

const idxArgs = config.idxArgs || {};
const inquiryArgs = config.inquiryArgs || {};

if (config.withP1Events) {
if (withP1Events) {
P1Events(Browser);
}

Expand Down

0 comments on commit a13e526

Please sign in to comment.