Allow refilling Shakespeare credits from Quilly

This commit is contained in:
Alex Gleason committed 2025-09-24 21:55:28 -05:00
1 parent ec5d84d3f7
commit db57619bca
2 files changed
+49 -14

No files matched your search

+10 -2
View File
@@ -92,10 +92,10 @@ export const ChatPane = forwardRef<ChatPaneRef, ChatPaneProps>(({
}
}, [providerModel, settings.recentlyUsedModels]);
// Reset state when navigating between projects
// Reset error state when navigating between projects and switching models
useEffect(() => {
setAIError(null);
}, [projectId]);
}, [projectId, providerModel]);
const [searchParams, setSearchParams] = useSearchParams();
const { fs } = useFS();
@@ -233,6 +233,11 @@ export const ChatPane = forwardRef<ChatPaneRef, ChatPaneProps>(({
setIsModelSelectorOpen(true);
}, []);
// Scroll to bottom when AI error occurs
useEffect(() => {
scrollToBottom();
}, [aiError, scrollToBottom]);
// Check for autostart parameter and trigger AI generation
useEffect(() => {
if (autostartedRef.current) return;
@@ -377,6 +382,8 @@ export const ChatPane = forwardRef<ChatPaneRef, ChatPaneProps>(({
// If configured but no model selected, don't proceed
if (!providerModel.trim()) return;
setAIError(null);
const modelToUse = providerModel.trim();
// Build message content as text parts
@@ -589,6 +596,7 @@ export const ChatPane = forwardRef<ChatPaneRef, ChatPaneProps>(({
onDismiss={() => setAIError(null)}
onNewChat={onNewChat}
onOpenModelSelector={openModelSelector}
providerModel={providerModel}
/>
)}
</div>