mirror of
https://github.com/ToolJet/ToolJet
synced 2026-05-24 01:18:23 +00:00
fixes icon crash for plugins (#4744)
This commit is contained in:
parent
572db9d09f
commit
c1f0408605
2 changed files with 3 additions and 1 deletions
|
|
@ -78,7 +78,7 @@ export const LeftSidebarInspector = ({
|
|||
}
|
||||
const icon = dataSources.find((ds) => ds.kind === value.kind);
|
||||
const iconFile = icon?.plugin?.icon_file?.data ?? undefined;
|
||||
const Icon = () => getSvgIcon(icon.kind, 25, 25, iconFile);
|
||||
const Icon = () => getSvgIcon(icon?.kind, 25, 25, iconFile ?? undefined);
|
||||
return { iconName: key, jsx: () => <Icon style={{ height: 16, width: 16, marginRight: 12 }} /> };
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -997,6 +997,8 @@ export const getSvgIcon = (key, height = 50, width = 50, iconFile = undefined, s
|
|||
if (key === 'runjs') return <RunjsIcon style={{ height, width }} />;
|
||||
const Icon = allSvgs[key];
|
||||
|
||||
if (!Icon) return <></>;
|
||||
|
||||
return <Icon style={{ height, width, ...styles }} />;
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue