Skip to content

Commit b54f479

Browse files
authored
Merge pull request #1147 from bryanhoffman/main
Fix for #1143 Added p5.min.js in such a way that it prevents a race condition on th…
2 parents da3c1aa + 2ead9ba commit b54f479

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/components/CodeEmbed/frame.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ ${code.css || ""}
4444
</style>
4545
<!-- If we need an addon script, load p5 the usual way with no caching to make sure
4646
the import order doesn't get messed up. -->
47-
${((code.scripts?.length ?? 0) > 0 ? [cdnLibraryUrl, ...(code.scripts ?? [])] : []).map((src) => `<script type="text/javascript" src="${src}"></script>`).join('\n')}
47+
${((code.scripts?.length ?? 0) > 0 ? [(code.scripts ?? [])] : []).map((src) => `<script type="text/javascript" src="${src}"></script>`).join('\n')}
4848
<body>${code.htmlBody || ""}</body>
4949
<script id="code" type="text/javascript">${wrapSketch(code.js) || ""}</script>
5050
${(code.scripts?.length ?? 0) > 0 ? '' : `

src/components/CodeEmbed/index.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ export const CodeEmbed = (props) => {
9696
base={props.base}
9797
frameRef={codeFrameRef}
9898
lazyLoad={props.lazyLoad}
99-
scripts={props.includeSound ? [cdnSoundUrl] : []}
99+
scripts={props.includeSound ? [cdnLibraryUrl, cdnSoundUrl] :[cdnLibraryUrl]}
100100
/>
101101
</div>
102102
<div className={`flex gap-2.5 ${largeSketch ? "flex-row" : "md:flex-row lg:flex-col"}`}>

0 commit comments

Comments
 (0)