mirror of
https://github.com/scratchfoundation/scratch-vm.git
synced 2024-12-23 14:32:59 -05:00
Ensure that md5 and assetId stay in sync.
This commit is contained in:
parent
9d8602db93
commit
c0afcd2ab3
2 changed files with 2 additions and 1 deletions
|
@ -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});
|
||||
}
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue