forked from mystiq/hydrogen-web
Continue with other items if this throws
This commit is contained in:
parent
d688fa4737
commit
6718198d9c
1 changed files with 10 additions and 5 deletions
|
@ -76,11 +76,16 @@ export class ThemeLoader {
|
||||||
const themeName = manifest.name;
|
const themeName = manifest.name;
|
||||||
let defaultDarkVariant: any = {}, defaultLightVariant: any = {};
|
let defaultDarkVariant: any = {}, defaultLightVariant: any = {};
|
||||||
for (let [themeId, cssLocation] of Object.entries(builtAssets)) {
|
for (let [themeId, cssLocation] of Object.entries(builtAssets)) {
|
||||||
/**
|
try {
|
||||||
* This cssLocation is relative to the location of the manifest file.
|
/**
|
||||||
* So we first need to resolve it relative to the root of this hydrogen instance.
|
* This cssLocation is relative to the location of the manifest file.
|
||||||
*/
|
* So we first need to resolve it relative to the root of this hydrogen instance.
|
||||||
cssLocation = new URL(cssLocation, new URL(manifestLocation, window.location.origin)).href;
|
*/
|
||||||
|
cssLocation = new URL(cssLocation, new URL(manifestLocation, window.location.origin)).href;
|
||||||
|
}
|
||||||
|
catch {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
const variant = themeId.match(/.+-(.+)/)?.[1];
|
const variant = themeId.match(/.+-(.+)/)?.[1];
|
||||||
const { name: variantName, default: isDefault, dark } = manifest.values.variants[variant!];
|
const { name: variantName, default: isDefault, dark } = manifest.values.variants[variant!];
|
||||||
const themeDisplayName = `${themeName} ${variantName}`;
|
const themeDisplayName = `${themeName} ${variantName}`;
|
||||||
|
|
Loading…
Reference in a new issue