Show top level dir (#4165)

* Reload FileTree and File when changed externally

* Added tests

* Show project root in files pane

* Cut off titles that are too long

* Fix tests
This commit is contained in:
49fl
2024-10-28 14:29:47 -04:00
committed by GitHub
parent 4a62862ca0
commit 05610bb0f3
11 changed files with 81 additions and 29 deletions

View File

@ -120,7 +120,7 @@ export async function getSettingsFolderPaths(projectPath?: string) {
}
}
export async function createAndOpenNewProject({
export async function createAndOpenNewTutorialProject({
onProjectOpen,
navigate,
}: {
@ -144,6 +144,22 @@ export async function createAndOpenNewProject({
ONBOARDING_PROJECT_NAME,
nextIndex
)
// Delete the tutorial project if it already exists.
if (isDesktop()) {
if (configuration.settings?.project?.directory === undefined) {
return Promise.reject(new Error('configuration settings are undefined'))
}
const fullPath = window.electron.join(
configuration.settings.project.directory,
name
)
if (window.electron.exists(fullPath)) {
await window.electron.rm(fullPath)
}
}
const newProject = await createNewProjectDirectory(
name,
bracket,