Skip to content
Snippets Groups Projects
Commit 34e764c9 authored by DD Liu's avatar DD Liu
Browse files

Don't try to convert to binary twice

parent 955f328d
No related branches found
No related tags found
No related merge requests found
......@@ -113,13 +113,13 @@ const costumeUpload = function (fileData, fileType, costumeName, storage, handle
}
const bitmapAdapter = new BitmapAdapter();
const addCostumeFromBuffer = function (dataURI) {
const addCostumeFromBuffer = function (dataBuffer) {
const vmCostume = cacheAsset(
storage,
costumeName,
assetType,
costumeFormat,
bitmapAdapter.convertDataURIToBinary(dataURI)
dataBuffer
);
handleCostume(vmCostume);
};
......@@ -132,7 +132,7 @@ const costumeUpload = function (fileData, fileType, costumeName, storage, handle
addCostumeFromBuffer(null, new Uint8Array(fileData));
} else {
// otherwise it's a bitmap
bitmapAdapter.importBitmap(fileData, fileType).then(value => addCostumeFromBuffer(value));
bitmapAdapter.importBitmap(fileData, fileType).then(addCostumeFromBuffer);
}
};
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment