Merge pull request #15 from rowboatlabs/dev

fix playground chat effects
This commit is contained in:
Ramnique Singh 2025-02-04 17:23:41 +05:30 committed by GitHub
commit 38fa36d8d0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 9 additions and 2 deletions

View file

@ -53,6 +53,7 @@ export function Chat({
createdAt: new Date().toISOString(),
}];
setMessages(updatedMessages);
setFetchResponseError(null);
}
function handleToolCallResults(results: z.infer<typeof apiV1.ToolMessage>[]) {
@ -126,9 +127,11 @@ export function Chat({
setFetchResponseError(`Failed to get assistant response: ${err instanceof Error ? err.message : 'Unknown error'}`);
}
} finally {
if (!ignore) {
setLoadingAssistantResponse(false);
}
}
}
// if no messages, return
if (messages.length === 0) {
@ -183,6 +186,7 @@ export function Chat({
chatId: chatId ?? '',
createdAt: new Date().toISOString(),
}]);
setFetchResponseError(null);
} catch (err) {
setFetchResponseError(`Failed to simulate user response: ${err instanceof Error ? err.message : 'Unknown error'}`);
} finally {

View file

@ -220,6 +220,7 @@ function App({
role: 'user',
content: prompt,
}]);
setResponseError(null);
}
const handleApplyChange = useCallback((
@ -351,9 +352,11 @@ function App({
setResponseError(`Failed to get copilot response: ${err instanceof Error ? err.message : 'Unknown error'}`);
}
} finally {
if (!ignore) {
setLoadingResponse(false);
}
}
}
// if no messages, return
if (messages.length === 0) {