Fix navigating back to project with no main.kcl
This commit is contained in:
@ -249,7 +249,7 @@ const collectAllFilesRecursiveFrom = async (path: string) => {
|
|||||||
return entry
|
return entry
|
||||||
}
|
}
|
||||||
|
|
||||||
const getDefaultKclFileForDir = async (projectDir: string, file: FileEntry) => {
|
export const getDefaultKclFileForDir = async (projectDir: string, file: FileEntry) => {
|
||||||
// Make sure the dir is a directory.
|
// Make sure the dir is a directory.
|
||||||
const isFileEntryDir = await window.electron.statIsDirectory(projectDir)
|
const isFileEntryDir = await window.electron.statIsDirectory(projectDir)
|
||||||
if (!isFileEntryDir) {
|
if (!isFileEntryDir) {
|
||||||
|
|||||||
@ -90,14 +90,13 @@ export const fileLoader: LoaderFunction = async (
|
|||||||
let code = ''
|
let code = ''
|
||||||
|
|
||||||
if (!urlObj.pathname.endsWith('/settings')) {
|
if (!urlObj.pathname.endsWith('/settings')) {
|
||||||
// TODO: PROJECT_ENTRYPOINT is hardcoded
|
|
||||||
// until we support setting a project's entrypoint file
|
|
||||||
if (!current_file_name || !current_file_path || !project_name) {
|
if (!current_file_name || !current_file_path || !project_name) {
|
||||||
|
const project = await getProjectInfo(project_path)
|
||||||
return redirect(
|
return redirect(
|
||||||
`${paths.FILE}/${encodeURIComponent(
|
`${paths.FILE}/${encodeURIComponent(
|
||||||
`${params.id}${
|
isDesktop()
|
||||||
isDesktop() ? window.electron.path.sep : '/'
|
? project.default_file
|
||||||
}${PROJECT_ENTRYPOINT}`
|
: (params.id + '/' + PROJECT_ENTRYPOINT)
|
||||||
)}`
|
)}`
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user