Skip to content

Commit 2279d3a

Browse files
committed
Use latest p5/p5.sound in textarea
1 parent c1f9dce commit 2279d3a

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

client/modules/IDE/components/Preferences/index.jsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import {
1919
setLinewrap,
2020
setPreferencesTab
2121
} from '../../actions/preferences';
22-
import { p5SoundURL, useP5Version } from '../../hooks/useP5Version';
22+
import { p5SoundURL, p5URL, useP5Version } from '../../hooks/useP5Version';
2323
import VersionPicker from '../VersionPicker';
2424
import { updateFileContent } from '../../actions/files';
2525
import { CmControllerContext } from '../../pages/IDEView';
@@ -521,8 +521,8 @@ export default function Preferences() {
521521
<TextArea
522522
className="preference__textarea"
523523
src={
524-
'<script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.7.0/p5.js"></script>\n' +
525-
'<script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.7.0/addons/p5.sound.min.js"></script>'
524+
`<script src="${p5URL}"></script>\n` +
525+
`<script src="${p5SoundURL}"></script>`
526526
}
527527
/>
528528
</div>

client/modules/IDE/hooks/useP5Version.jsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,7 @@ export const currentP5Version = p5Versions[0];
138138
export const p5SoundURL = `https://cdnjs.cloudflare.com/ajax/libs/p5.js/${currentP5Version}/addons/p5.sound.min.js`;
139139
export const p5PreloadAddonURL = 'https://TODO/preload.js';
140140
export const p5ShapesAddonURL = 'https://TODO/shapes.js';
141+
export const p5URL = `https://cdnjs.cloudflare.com/ajax/libs/p5.js/${currentP5Version}/p5.js`;
141142

142143
const P5VersionContext = React.createContext({});
143144

0 commit comments

Comments
 (0)