We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 880c24e + 31a63b6 commit bd16286Copy full SHA for bd16286
1 file changed
src/components/ai-elements/custom/code-editor.tsx
@@ -184,9 +184,10 @@ export const CodeEditor = ({
184
await navigator.clipboard.writeText(activeFile.content);
185
setCopied(true);
186
setTimeout(() => setCopied(false), 2000);
187
- }, []);
+ }, [activeFile]);
188
189
const handleDownload = useCallback(() => {
190
+ if (!activeFile) {return;}
191
const blob = new Blob([activeFile.content], { type: "text/plain" });
192
const url = URL.createObjectURL(blob);
193
const a = document.createElement("a");
0 commit comments