From 9a865fd76ff81ced5511b72953053d4299b47894 Mon Sep 17 00:00:00 2001 From: AC Date: Sun, 6 Apr 2025 17:22:45 +0800 Subject: [PATCH] Update ChatActions to Assert Non-null Provider Name - Modified the assignment of `providerName` in `ChatActions` to assert non-null, ensuring type safety and preventing potential runtime errors. --- app/components/chat.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/components/chat.tsx b/app/components/chat.tsx index 8a9f42869..95cfa4747 100644 --- a/app/components/chat.tsx +++ b/app/components/chat.tsx @@ -741,7 +741,7 @@ export function ChatActions(props: { // Only update if we found a valid provider chatStore.updateTargetSession(session, (session) => { session.mask.modelConfig.model = model as ModelType; - session.mask.modelConfig.providerName = targetProvider; // Use the Enum value + session.mask.modelConfig.providerName = targetProvider!; // Use the Enum value (Assert non-null) session.mask.syncGlobalConfig = false; console.log( "[ChatActions] Updated session modelConfig:",