From 5558a0f2cd809f1532c20d1150c15124fd103889 Mon Sep 17 00:00:00 2001 From: Lea Verou Date: Fri, 9 May 2025 12:48:47 -0400 Subject: [PATCH] If no `system()` is defined, route through WA immediately --- src/components/icon/library.ts | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/src/components/icon/library.ts b/src/components/icon/library.ts index 6b040a5c2..b829565b7 100644 --- a/src/components/icon/library.ts +++ b/src/components/icon/library.ts @@ -10,16 +10,12 @@ export const CACHEABLE_HTTP_ERRORS = [410]; let parser: DOMParser; const defaultFallback = function (name: string, family?: string, variant?: string): IconLocator | undefined { - if (this.name !== 'wa') { - return { - name, - family, - variant, - library: 'wa', - }; - } - - return undefined; + return { + name, + family, + variant, + library: 'wa', + }; }; export default class IconLibrary { @@ -44,7 +40,9 @@ export default class IconLibrary { // Copy certain properties this.name = library.name; this.mutator = library.mutator; - this.system = library.system; + // Resolve system icons through the default icon library if no system() function is provided + this.system = library.system ?? defaultFallback; + // Resolve failed to load icons through the default icon library if no fallback() function is provided this.fallback = library.fallback ?? defaultFallback; if (library.inlined) {