Reload projects when there are external changes on the file-system (#4077)

This commit is contained in:
49fl
2024-10-03 13:02:57 -04:00
committed by GitHub
parent e1406012b4
commit 115e6baa53
10 changed files with 239 additions and 28 deletions

View File

@ -12,11 +12,7 @@ import { loadAndValidateSettings } from './settings/settingsUtils'
import makeUrlPathRelative from './makeUrlPathRelative'
import { codeManager } from 'lib/singletons'
import { fileSystemManager } from 'lang/std/fileSystemManager'
import {
getProjectInfo,
ensureProjectDirectoryExists,
listProjects,
} from './desktop'
import { getProjectInfo } from './desktop'
import { createSettings } from './settings/initialSettings'
// The root loader simply resolves the settings and any errors that
@ -184,21 +180,7 @@ export const homeLoader: LoaderFunction = async (): Promise<
if (!isDesktop()) {
return redirect(PATHS.FILE + '/%2F' + BROWSER_PROJECT_NAME)
}
const { configuration } = await loadAndValidateSettings()
const projectDir = await ensureProjectDirectoryExists(configuration)
if (projectDir) {
const projects = await listProjects(configuration)
return {
projects,
}
} else {
return {
projects: [],
}
}
return {}
}
const normalizeLineEndings = (str: string, normalized = '\n') => {