mirror of
https://github.com/leporello-js/leporello-js
synced 2026-01-13 13:04:30 -08:00
fix
This commit is contained in:
@@ -540,11 +540,11 @@ const change_current_module = (state, current_module) => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const change_entrypoint = (state, entrypoint) => {
|
const change_entrypoint = (state, entrypoint, current_module = entrypoint) => {
|
||||||
return run_code(
|
return run_code(
|
||||||
{...state,
|
{...state,
|
||||||
entrypoint,
|
entrypoint,
|
||||||
current_module: entrypoint,
|
current_module,
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -226,33 +226,32 @@ export class Files {
|
|||||||
exec('change_current_module', file.path)
|
exec('change_current_module', file.path)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
if(file.path == null) {
|
if(file.path == null) {
|
||||||
// root of examples dir, do nothing
|
// root of examples dir, do nothing
|
||||||
return
|
} else if(file.path == '') {
|
||||||
}
|
|
||||||
|
|
||||||
if(file.path == '') {
|
|
||||||
exec('change_entrypoint', '')
|
exec('change_entrypoint', '')
|
||||||
return
|
} else {
|
||||||
}
|
const find_node = n =>
|
||||||
|
n.path == file.path
|
||||||
|
||
|
||||||
|
n.children != null && n.children.find(find_node)
|
||||||
|
|
||||||
const find_node = n =>
|
// find example dir
|
||||||
n.path == file.path
|
const example_dir = get_state().project_dir.children.find(
|
||||||
||
|
c => find_node(c) != null
|
||||||
n.children != null && n.children.find(find_node)
|
)
|
||||||
|
|
||||||
// find example dir
|
// in examples mode, on click file we also change entrypoint for
|
||||||
const example_dir = get_state().project_dir.children.find(
|
// simplicity
|
||||||
c => find_node(c) != null
|
const example = examples.find(e => e.path == example_dir.path)
|
||||||
)
|
exec(
|
||||||
|
'change_entrypoint',
|
||||||
// in examples mode, on click file we also change entrypoint for
|
example.entrypoint,
|
||||||
// simplicity
|
file.kind == 'directory' ? undefined : file.path
|
||||||
const example = examples.find(e => e.path == example_dir.path)
|
)
|
||||||
exec('change_entrypoint', example.entrypoint)
|
if(example.with_app_window && !localStorage.onboarding_open_app_window) {
|
||||||
if(example.with_app_window && !localStorage.onboarding_open_app_window) {
|
this.ui.toggle_open_app_window_tooltip(true)
|
||||||
this.ui.toggle_open_app_window_tooltip(true)
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user