Skip to content

Commit

Permalink
MWPW-161174 fixed library query param (#3128)
Browse files Browse the repository at this point in the history
  • Loading branch information
cod17828 authored Nov 6, 2024
1 parent 8be7f3c commit fb85f29
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions libs/blocks/library-config/library-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,9 +112,7 @@ async function loadList(type, content, list) {
}
}

async function fetchLibrary(domain) {
const { searchParams } = new URL(window.location.href);
const suppliedLibrary = searchParams.get('library');
async function fetchLibrary(domain, suppliedLibrary) {
const library = suppliedLibrary || `${domain}${LIBRARY_PATH}`;
try {
const resp = await fetch(library);
Expand All @@ -129,8 +127,9 @@ async function getSuppliedLibrary() {
const { searchParams } = new URL(window.location.href);
const repo = searchParams.get('repo');
const owner = searchParams.get('owner');
const library = searchParams.get('library');
if (!repo || !owner) return null;
return fetchLibrary(`https://main--${repo}--${owner}.hlx.live`);
return fetchLibrary(`https://main--${repo}--${owner}.hlx.live`, library);
}

async function fetchAssetsData(path) {
Expand Down

0 comments on commit fb85f29

Please sign in to comment.