fix(Icon/Minimal): unknown endpoint handling (#1059)

This commit is contained in:
Danny Avila 2023-10-16 13:34:29 -04:00 committed by GitHub
parent a53ccf0d72
commit 0450c34e3b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 2 deletions

View file

@ -77,7 +77,8 @@ const Icon: React.FC<IconProps> = (props) => {
default: { icon: <GPTIcon size={size * 0.7} />, bg: 'grey', name: 'UNKNOWN' }, default: { icon: <GPTIcon size={size * 0.7} />, bg: 'grey', name: 'UNKNOWN' },
}; };
const { icon, bg, name } = endpointIcons[endpoint ?? 'default']; const { icon, bg, name } =
endpoint && endpointIcons[endpoint] ? endpointIcons[endpoint] : endpointIcons.default;
return ( return (
<div <div

View file

@ -31,7 +31,7 @@ const MinimalIcon: React.FC<IconProps> = (props) => {
default: { icon: <OpenAIMinimalIcon />, name: 'UNKNOWN' }, default: { icon: <OpenAIMinimalIcon />, name: 'UNKNOWN' },
}; };
const { icon, name } = endpointIcons[endpoint]; const { icon, name } = endpointIcons[endpoint] ?? endpointIcons.default;
return ( return (
<div <div