From 69244ba445393f8bc477d5c9a0753f0f82f4a427 Mon Sep 17 00:00:00 2001 From: Chandler Abraham Date: Sat, 31 May 2025 15:08:45 -0700 Subject: [PATCH] fix download button, was returning undefined as file contents --- website/src/repl/components/DownloadButton.jsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/website/src/repl/components/DownloadButton.jsx b/website/src/repl/components/DownloadButton.jsx index adbcf6947..a582a7bb3 100644 --- a/website/src/repl/components/DownloadButton.jsx +++ b/website/src/repl/components/DownloadButton.jsx @@ -3,7 +3,7 @@ import { useCallback } from 'react'; export default function DownloadButton({ context }) { const handleDownload = useCallback(() => { // Get the current code from the editor - const code = context.code; + const code = context.editorRef?.current?.code || ''; // Create a blob with the code const blob = new Blob([code], { type: 'text/javascript' }); @@ -21,7 +21,7 @@ export default function DownloadButton({ context }) { // Clean up the URL window.URL.revokeObjectURL(url); - }, [context.code]); + }, []); return (