From ba5c8d823dc3180c489dfe26191876fc5f0a482b Mon Sep 17 00:00:00 2001 From: Nick O'Leary Date: Fri, 17 Jan 2025 17:06:17 +0000 Subject: [PATCH] Fix library icon handling within library browser component Closes #5004 --- .../@node-red/editor-client/src/js/ui/library.js | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/packages/node_modules/@node-red/editor-client/src/js/ui/library.js b/packages/node_modules/@node-red/editor-client/src/js/ui/library.js index 0098bc947..64b1f1547 100644 --- a/packages/node_modules/@node-red/editor-client/src/js/ui/library.js +++ b/packages/node_modules/@node-red/editor-client/src/js/ui/library.js @@ -245,10 +245,15 @@ RED.library = (function() { if (lib.types && lib.types.indexOf(options.url) === -1) { return; } + let icon = 'fa fa-hdd-o'; + if (lib.icon) { + const fullIcon = RED.utils.separateIconPath(lib.icon); + icon = (fullIcon.module==="font-awesome"?"fa ":"")+fullIcon.file; + } listing.push({ library: lib.id, type: options.url, - icon: lib.icon || 'fa fa-hdd-o', + icon, label: RED._(lib.label||lib.id), path: "", expanded: true, @@ -303,10 +308,15 @@ RED.library = (function() { if (lib.types && lib.types.indexOf(options.url) === -1) { return; } + let icon = 'fa fa-hdd-o'; + if (lib.icon) { + const fullIcon = RED.utils.separateIconPath(lib.icon); + icon = (fullIcon.module==="font-awesome"?"fa ":"")+fullIcon.file; + } listing.push({ library: lib.id, type: options.url, - icon: lib.icon || 'fa fa-hdd-o', + icon, label: RED._(lib.label||lib.id), path: "", expanded: true,