Reload projects when there are external changes on the file-system (#4077)
This commit is contained in:
@ -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') => {
|
||||
|
Reference in New Issue
Block a user