Skip encoding/decoding step when importing and downloading projects

This commit is contained in:
Misode
2024-11-26 01:15:24 +01:00
parent ef03fe6058
commit d370b4244a
3 changed files with 10 additions and 9 deletions

View File

@@ -47,8 +47,7 @@ export function ProjectPanel() {
if (!download.current || entries === undefined) return
const zipEntries = await Promise.all(entries.map(async e => {
const data = await client.fs.readFile(projectRoot + e)
const text = new TextDecoder().decode(data)
return [e, text] as [string, string]
return [e, data] as [string, Uint8Array]
}))
const url = await writeZip(zipEntries)
download.current.setAttribute('href', url)