Update StoryEditorClient with new API key dependency

This commit is contained in:
Riccardo Giorato
2026-01-06 13:45:42 +01:00
parent 120d011f06
commit f4bb681e05
4 changed files with 24 additions and 59 deletions
@@ -67,6 +67,7 @@ export function StoryEditorClient() {
const { toast } = useToast();
const [apiKey, setApiKey] = useApiKey();
const handleTitleUpdate = (newTitle: string) => {
setStory(prev => prev ? { ...prev, title: newTitle } : null);
};
@@ -166,12 +167,14 @@ export function StoryEditorClient() {
window.addEventListener("keydown", handleKeyDown);
return () => window.removeEventListener("keydown", handleKeyDown);
}, [pages.length]);
}, [pages.length, apiKey]);
const handleAddPage = () => {
if (!isLoaded || !isSignedIn) {
return;
}
if (!apiKey && pages.length >= 1) {
setShowApiModal(true);
return;