From 88396b31367c64c8babd3bf78ed4e5af9ed1bb6a Mon Sep 17 00:00:00 2001 From: splincode Date: Wed, 9 Oct 2024 11:26:30 +0300 Subject: [PATCH] fix(core): support provide empty icon value --- projects/core/tokens/icon-resolver.ts | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/projects/core/tokens/icon-resolver.ts b/projects/core/tokens/icon-resolver.ts index 2c3230374004..aee6c92c6f73 100644 --- a/projects/core/tokens/icon-resolver.ts +++ b/projects/core/tokens/icon-resolver.ts @@ -23,12 +23,10 @@ export function tuiInjectIconResolver(): TuiStringHandler { const icons = inject(TUI_ICON_REGISTRY); const resolver = inject(TUI_ICON_RESOLVER); - return (icon) => (!icon || icon.includes('/') ? icon : icons[icon] || resolver(icon)); + return (icon) => + !icon || icon.includes('/') ? icon : (icons[icon] ?? resolver(icon)); } export function tuiIconResolverProvider(useValue: TuiStringHandler): Provider { - return { - provide: TUI_ICON_RESOLVER, - useValue, - }; + return {provide: TUI_ICON_RESOLVER, useValue}; }