Skip to content

Commit

Permalink
Remove dependency on helpers.js
Browse files Browse the repository at this point in the history
  • Loading branch information
TsayAdobe committed Jul 8, 2024
1 parent 28f5656 commit ce3f8ea
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
4 changes: 1 addition & 3 deletions libs/features/icons/icons.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@ let fetched = false;
async function getSVGsfromFile(path) {
/* c8 ignore next */
if (!path) return null;
const { customFetch } = await import('../../utils/helpers.js');
const resp = await customFetch({ resource: path, withCacheRules: true })
.catch(() => ({}));
const resp = await fetch(path);
/* c8 ignore next */
if (!resp.ok) return null;
const miloIcons = {};
Expand Down
4 changes: 1 addition & 3 deletions libs/utils/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -708,11 +708,9 @@ function decorateHeader() {
async function decorateIcons(area, config) {
const icons = area.querySelectorAll('span.icon');
if (icons.length === 0) return;
const { miloLibs, codeRoot } = config;
const base = miloLibs || codeRoot;
const { base } = config;
loadStyle(`${base}/features/icons/icons.css`);
loadLink(`${base}/img/icons/icons.svg`, { rel: 'preload', as: 'fetch', crossorigin: 'anonymous' });
loadLink(`${base}/utils/helpers.js`, { rel: 'preload', as: 'script', crossorigin: 'anonymous' });
const { default: loadIcons } = await import('../features/icons/icons.js');
await loadIcons(icons, config);
}
Expand Down

0 comments on commit ce3f8ea

Please sign in to comment.