diff --git a/src/app.tsx b/src/app.tsx index a6aaea9..edaf05c 100644 --- a/src/app.tsx +++ b/src/app.tsx @@ -255,14 +255,6 @@ function AppContent() { const runCodeRef = useRef(runCode); runCodeRef.current = runCode; - async function shareCode() { - setSharingOpen(true); - setShareURL(''); - let fragment = await createShareFragment(amaranthSource, amaranthVersion); - let url = new URL('#' + fragment, window.location.href).toString(); - setShareURL(url); - } - const amaranthSourceEditorActions = React.useMemo(() => [ { id: 'amaranth-playground.run', @@ -270,10 +262,18 @@ function AppContent() { keybindings: [ monaco.KeyMod.CtrlCmd | monaco.KeyCode.Enter, ], - run: runCodeRef.current, + run: () => runCodeRef.current(), } ], [runCodeRef]); + async function shareCode() { + setSharingOpen(true); + setShareURL(''); + let fragment = await createShareFragment(amaranthSource, amaranthVersion); + let url = new URL('#' + fragment, window.location.href).toString(); + setShareURL(url); + } + function tabAndPanel({ key, title, titleStyle = {}, content }) { return [ {title},