Fix GlobalChatProvider parseProviderModel usage

The parseProviderModel function returns { model, provider } but the code
was trying to destructure { providerId, modelId }. Fixed to correctly
use the actual return values and pass the required providers array
parameter to the function.
This commit is contained in:
MK Fain committed 2025-12-03 20:10:18 -06:00
1 parent 0c4de2e2c0
commit e23c843ef9
1 file changed
+3 -4
+3 -4
View File
@@ -65,15 +65,14 @@ export function GlobalChatProvider({ children }: GlobalChatProviderProps) {
return trimmedMessages;
}, []);
const sendMessage = useCallback(async (content: string, providerModel: string) => {
const sendMessage = useCallback(async (content: string, providerModelString: string) => {
if (!content.trim() || isLoading) return;
// Parse provider and model
const { providerId, modelId } = parseProviderModel(providerModel);
const provider = settings.providers.find(p => p.id === providerId);
const { model: modelId, provider } = parseProviderModel(providerModelString, settings.providers);
if (!provider) {
console.error('Provider not found:', providerId);
console.error('Provider not found');
return;
}