some notes for base64 to blob conversion on load

main
km0 1 year ago
parent 776d490ca2
commit 342371711e

@ -44,13 +44,15 @@ const add = () => {
const load = (e) => {
let files = e.target.files
new Promise.all(files.forEach(async (file) =>{
Promise.all(files.forEach(async (file) =>{
const reader = new FileReader()
reader.readAsText(file)
reader.onloadend = (e) => {
if (e.target.readyState == FileReader.DONE) {
try {
let scene = JSON.parse(reader.result)
// convert base64 to blob to avoid DOM lag during drag and drop
// bc base64 bloat the html document so much!
scenes.value.push(scene)
} catch (e) {
console.log(e)

Loading…
Cancel
Save