Merge pull request #795 from quantified-uncertainty/fix-playground-links
This commit is contained in:
		
						commit
						d096bd1f24
					
				| 
						 | 
					@ -36,11 +36,16 @@ function setHashData(data) {
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
export default function PlaygroundPage() {
 | 
					export default function PlaygroundPage() {
 | 
				
			||||||
 | 
					  const hashData = getHashData();
 | 
				
			||||||
 | 
					  if (hashData.initialSquiggleString) {
 | 
				
			||||||
 | 
					    hashData.defaultCode = String(hashData.initialSquiggleString);
 | 
				
			||||||
 | 
					    delete hashData.initialSquiggleString;
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
  const playgroundProps = {
 | 
					  const playgroundProps = {
 | 
				
			||||||
    defaultCode: "normal(0,1)",
 | 
					    defaultCode: "normal(0,1)",
 | 
				
			||||||
    height: 700,
 | 
					    height: 700,
 | 
				
			||||||
    showTypes: true,
 | 
					    showTypes: true,
 | 
				
			||||||
    ...getHashData(),
 | 
					    ...hashData,
 | 
				
			||||||
    onCodeChange: (code) => setHashData({ initialSquiggleString: code }),
 | 
					    onCodeChange: (code) => setHashData({ initialSquiggleString: code }),
 | 
				
			||||||
    onSettingsChange: (settings) => {
 | 
					    onSettingsChange: (settings) => {
 | 
				
			||||||
      const { showTypes, showControls, showSummary, showEditor } = settings;
 | 
					      const { showTypes, showControls, showSummary, showEditor } = settings;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue
	
	Block a user