only eval if script
This commit is contained in:
parent
f80fdbc38a
commit
4caacb0de1
1 changed files with 3 additions and 2 deletions
|
|
@ -47,7 +47,6 @@ if (typeof window !== 'undefined') {
|
||||||
multiChannelOrbits: parseBoolean(multiChannelOrbits),
|
multiChannelOrbits: parseBoolean(multiChannelOrbits),
|
||||||
});
|
});
|
||||||
modulesLoading = loadModules();
|
modulesLoading = loadModules();
|
||||||
// prebakeScript = evaluate(settingsMap.get().prebakeScript ?? '')
|
|
||||||
presets = prebake();
|
presets = prebake();
|
||||||
drawContext = getDrawContext();
|
drawContext = getDrawContext();
|
||||||
clearCanvas = () => drawContext.clearRect(0, 0, drawContext.canvas.height, drawContext.canvas.width);
|
clearCanvas = () => drawContext.clearRect(0, 0, drawContext.canvas.height, drawContext.canvas.width);
|
||||||
|
|
@ -86,7 +85,9 @@ export function useReplContext() {
|
||||||
drawContext,
|
drawContext,
|
||||||
prebake: async () =>
|
prebake: async () =>
|
||||||
Promise.all([modulesLoading, presets]).then(() => {
|
Promise.all([modulesLoading, presets]).then(() => {
|
||||||
return evaluate(prebakeScript ?? '');
|
if (prebakeScript?.length) {
|
||||||
|
return evaluate(prebakeScript ?? '');
|
||||||
|
}
|
||||||
}),
|
}),
|
||||||
onUpdateState: (state) => {
|
onUpdateState: (state) => {
|
||||||
setReplState({ ...state });
|
setReplState({ ...state });
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue