Merge pull request #795 from quantified-uncertainty/fix-playground-links

This commit is contained in:
Ozzie Gooen 2022-07-06 12:16:35 -04:00 committed by GitHub
commit d096bd1f24
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -36,11 +36,16 @@ function setHashData(data) {
}
export default function PlaygroundPage() {
const hashData = getHashData();
if (hashData.initialSquiggleString) {
hashData.defaultCode = String(hashData.initialSquiggleString);
delete hashData.initialSquiggleString;
}
const playgroundProps = {
defaultCode: "normal(0,1)",
height: 700,
showTypes: true,
...getHashData(),
...hashData,
onCodeChange: (code) => setHashData({ initialSquiggleString: code }),
onSettingsChange: (settings) => {
const { showTypes, showControls, showSummary, showEditor } = settings;