This commit is contained in:
Dmitry Vasilev
2023-06-11 00:04:42 +03:00
parent 624759e7a1
commit 387ede71c0
2 changed files with 3 additions and 3 deletions

2
src/effects.js vendored
View File

@@ -131,7 +131,7 @@ export const render_initial_state = (ui, state) => {
ui.editor.switch_session(state.current_module) ui.editor.switch_session(state.current_module)
} }
export const render_common_side_effects = (prev, next, command, ui) => { export const apply_side_effects = (prev, next, command, ui) => {
if( if(
prev.project_dir != next.project_dir prev.project_dir != next.project_dir
|| ||

View File

@@ -1,5 +1,5 @@
import {UI} from './editor/ui.js' import {UI} from './editor/ui.js'
import {EFFECTS, render_initial_state, render_common_side_effects} from './effects.js' import {EFFECTS, render_initial_state, apply_side_effects} from './effects.js'
import {load_dir} from './filesystem.js' import {load_dir} from './filesystem.js'
const EXAMPLE = `const fib = n => const EXAMPLE = `const fib = n =>
@@ -231,7 +231,7 @@ export const exec = (cmd, ...args) => {
with_code_execution(() => { with_code_execution(() => {
render_common_side_effects(state, nextstate, cmd, ui); apply_side_effects(state, nextstate, cmd, ui);
if(effects != null) { if(effects != null) {
(Array.isArray(effects) ? effects : [effects]).forEach(e => { (Array.isArray(effects) ? effects : [effects]).forEach(e => {