diff --git a/repl/src/App.js b/repl/src/App.js index 85ab9a64..d125f782 100644 --- a/repl/src/App.js +++ b/repl/src/App.js @@ -58,6 +58,7 @@ extend( }, ); +const initialUrl = window.location.href; const codeParam = window.location.href.split('#')[1]; let decoded; try { @@ -74,7 +75,7 @@ function getRandomTune() { const randomTune = getRandomTune(); const defaultSynth = getDefaultSynth(); - +const isEmbedded = window.location !== window.parent.location; function App() { // const [editor, setEditor] = useState(); const [view, setView] = useState(); @@ -100,7 +101,9 @@ function App() { const logBox = useRef(); // scroll log box to bottom when log changes useLayoutEffect(() => { - logBox.current.scrollTop = logBox.current?.scrollHeight; + if (logBox.current) { + logBox.current.scrollTop = logBox.current?.scrollHeight; + } }, [log]); // set active pattern on ctrl+enter @@ -148,16 +151,19 @@ function App() {