Skip to content

Commit 91bdfa7

Browse files
authored
Update external-services.js
1 parent 593474e commit 91bdfa7

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

config/var/www/admin/control-panel/external-services/external-services.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ const CATEGORY_ORDER = [
1919
'Security'
2020
];
2121

22+
// Accepts FA short style prefixes: fas, far, fab, fal, fad, fat.
23+
// Note: `fat` (thin) is a Font Awesome 6+ style; ensure the loaded FA version supports it.
2224
const FA_STYLE_PREFIX_SHORT_PATTERN = /^fa[rsbdlt]$/;
2325
const FA_STYLE_PREFIX_LONG_PATTERN = /^fa-(solid|regular|brands|light|duotone|thin)$/;
2426

@@ -940,8 +942,9 @@ export class ExternalServicesManager {
940942
const primary = parseIconInput(iconSuffix);
941943
const fallback = parseIconInput(fallbackSuffix);
942944

943-
const stylePrefix = primary.stylePrefix || fallback.stylePrefix || "fas";
944-
const safeSuffix = primary.iconName || fallback.iconName || DEFAULT_ICON_SUFFIX;
945+
const selected = primary.iconName ? primary : (fallback.iconName ? fallback : null);
946+
const stylePrefix = selected ? (selected.stylePrefix || "fas") : "fas";
947+
const safeSuffix = selected ? selected.iconName : DEFAULT_ICON_SUFFIX;
945948

946949
return sanitizeFaIconClass(`${stylePrefix} fa-${safeSuffix}`);
947950
}

0 commit comments

Comments
 (0)