Ensure that md5 and assetId stay in sync.

This commit is contained in:
Karishma Chadha 2018-03-05 15:16:00 -05:00
parent 9d8602db93
commit c0afcd2ab3
2 changed files with 2 additions and 1 deletions

View file

@ -19,7 +19,7 @@ const serializeAssets = function (runtime, assetType) {
const storage = runtime.storage;
const storedAsset = storage.get(assetId);
assetDescs.push({
fileName: assetType === 'sound' ?
fileName: currAsset.md5 ?
currAsset.md5 : `${assetId}.${storedAsset.dataFormat}`,
fileContent: storedAsset.data});
}

View file

@ -537,6 +537,7 @@ class VirtualMachine extends EventEmitter {
// If we're in here, we've edited an svg in the vector editor,
// so the dataFormat should be 'svg'
costume.dataFormat = storage.DataFormat.SVG;
costume.md5 = `${costume.assetId}.${costume.dataFormat}`;
this.emitTargetsUpdate();
}