From 579c61aef3d906399ccc0de84fadff08472f52c5 Mon Sep 17 00:00:00 2001 From: Karishma Chadha <kchadha@scratch.mit.edu> Date: Fri, 4 May 2018 15:54:42 -0400 Subject: [PATCH] Treat zips as sprite files as well. --- src/lib/file-uploader.js | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/lib/file-uploader.js b/src/lib/file-uploader.js index 12f67f8a4..c6bd45bad 100644 --- a/src/lib/file-uploader.js +++ b/src/lib/file-uploader.js @@ -175,10 +175,9 @@ const soundUpload = function (fileData, fileType, soundName, storage, handleSoun const spriteUpload = function (fileData, fileType, spriteName, storage, handleSprite) { switch (fileType) { - case '': { // We think this is a .sprite2 or .sprite3 file + case '': + case 'archive/zip': { // We think this is a .sprite2 or .sprite3 file handleSprite(new Uint8Array(fileData)); - // TODO VM addSprite function should handle - // buffers directly and get unpacked in scratch-parser return; } case 'image/svg+xml': @@ -209,10 +208,6 @@ const spriteUpload = function (fileData, fileType, spriteName, storage, handleSp })); return; } - // case 'archive/zip': { // sprite2 / sprite3 - // handleSprite(JSON.stringify(fileData.toString('utf-8'))); - // return; - // } default: { return; } -- GitLab