Skip to content

Commit 23346f6

Browse files
ui: fix-perplexity-icon
Added fallback icon for provider, fixes perplexity icon not showing
2 parents fc13754 + 558d4b2 commit 23346f6

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

app/components/settings/providers/ProvidersTab.tsx

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ import { LOCAL_PROVIDERS, URL_CONFIGURABLE_PROVIDERS } from '~/lib/stores/settin
55
import type { IProviderConfig } from '~/types/model';
66
import { logStore } from '~/lib/stores/logs';
77

8+
// Import a default fallback icon
9+
import DefaultIcon from '/icons/Ollama.svg'; // Adjust the path as necessary
10+
811
export default function ProvidersTab() {
912
const { providers, updateProviderSettings, isLocalModel } = useSettings();
1013
const [filteredProviders, setFilteredProviders] = useState<IProviderConfig[]>([]);
@@ -51,7 +54,14 @@ export default function ProvidersTab() {
5154
>
5255
<div className="flex items-center justify-between mb-2">
5356
<div className="flex items-center gap-2">
54-
<img src={`/icons/${provider.name}.svg`} alt={`${provider.name} icon`} className="w-6 h-6 dark:invert" />
57+
<img
58+
src={`/icons/${provider.name}.svg`} // Attempt to load the specific icon
59+
onError={(e) => { // Fallback to default icon on error
60+
e.currentTarget.src = DefaultIcon;
61+
}}
62+
alt={`${provider.name} icon`}
63+
className="w-6 h-6 dark:invert"
64+
/>
5565
<span className="text-bolt-elements-textPrimary">{provider.name}</span>
5666
</div>
5767
<Switch

0 commit comments

Comments
 (0)