Skip to content

Commit

Permalink
Revert "Adding support for getting env config through client env" (#2858
Browse files Browse the repository at this point in the history
)

Revert "Adding support for getting env config through client env (#2838)"

This reverts commit 8138b79.

Co-authored-by: Saloni Jain <6162294+salonijain3@users.noreply.github.com>
  • Loading branch information
mokimo and salonijain3 authored Sep 10, 2024
1 parent 2cc3d12 commit 2802011
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
2 changes: 1 addition & 1 deletion libs/navigation/navigation.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ export default async function loadBlock(configs, customLib) {
const {
header, footer, authoringPath, env = 'prod', locale = '', theme,
} = configs || {};
window.miloClientEnv = env;
const branch = new URLSearchParams(window.location.search).get('navbranch');
const miloLibs = branch ? `https://${branch}--milo--adobecom.hlx.page` : customLib || envMap[env];
if (!header && !footer) {
Expand Down Expand Up @@ -73,4 +72,5 @@ export default async function loadBlock(configs, customLib) {
}
});
}

window.loadNavigation = loadBlock;
5 changes: 1 addition & 4 deletions libs/utils/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -150,11 +150,8 @@ const PROMO_PARAM = 'promo';
function getEnv(conf) {
const { host } = window.location;
const query = PAGE_URL.searchParams.get('env');
if (query) return { ...ENVS[query], consumer: conf[query] };

const clientEnv = window.miloClientEnv;
if (clientEnv) return { ...ENVS[clientEnv], consumer: conf[clientEnv] };

if (query) return { ...ENVS[query], consumer: conf[query] };
if (host.includes('localhost')) return { ...ENVS.local, consumer: conf.local };
/* c8 ignore start */
if (host.includes(`${SLD}.page`)
Expand Down

0 comments on commit 2802011

Please sign in to comment.