Skip to content

Commit

Permalink
fix: support loading application/x-scratch3-sprite
Browse files Browse the repository at this point in the history
Installing `scratch3` or `scratch3-bin` from the AUR may cause the
browser to report `*.sb3` files as `application/x-scratch3-sprite`. This
change makes it so that won't break loading those sprites.
  • Loading branch information
cwillisf committed Feb 18, 2025
1 parent e32a49b commit 45c3305
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions packages/scratch-gui/src/lib/file-uploader.js
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,7 @@ const soundUpload = function (fileData, fileType, storage, handleSound, handleEr
const spriteUpload = function (fileData, fileType, spriteName, storage, handleSprite, handleError = () => {}) {
switch (fileType) {
case '':
case 'application/x-scratch3-sprite': // from AUR packages
case 'application/zip': { // We think this is a .sprite2 or .sprite3 file
handleSprite(new Uint8Array(fileData));
return;
Expand Down

0 comments on commit 45c3305

Please sign in to comment.