Fix #319 keep unknown files when importing and downloading a project

This commit is contained in:
Misode
2024-10-04 15:30:35 +02:00
parent 394beeab16
commit 5d08f15006
5 changed files with 23 additions and 9 deletions

View File

@@ -50,10 +50,15 @@ export function ProjectCreation({ onClose }: Props) {
try {
const data = await parseSource(entry[1], 'json')
project.files!.push({ ...file, data })
return
} catch (e) {
console.error(`Failed parsing ${file.type} ${file.id}: ${message(e)}`)
console.warn(`Failed parsing ${file.type} ${file.id}: ${message(e)}`)
}
}
if (project.unknownFiles === undefined) {
project.unknownFiles = []
}
project.unknownFiles.push({ path: entry[0], data: entry[1] })
}))
projectUpdater.current(project)
onClose()