mirror of
https://github.com/scratchfoundation/scratch-vm.git
synced 2024-12-24 15:02:52 -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 storage = runtime.storage;
|
||||||
const storedAsset = storage.get(assetId);
|
const storedAsset = storage.get(assetId);
|
||||||
assetDescs.push({
|
assetDescs.push({
|
||||||
fileName: assetType === 'sound' ?
|
fileName: currAsset.md5 ?
|
||||||
currAsset.md5 : `${assetId}.${storedAsset.dataFormat}`,
|
currAsset.md5 : `${assetId}.${storedAsset.dataFormat}`,
|
||||||
fileContent: storedAsset.data});
|
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,
|
// If we're in here, we've edited an svg in the vector editor,
|
||||||
// so the dataFormat should be 'svg'
|
// so the dataFormat should be 'svg'
|
||||||
costume.dataFormat = storage.DataFormat.SVG;
|
costume.dataFormat = storage.DataFormat.SVG;
|
||||||
|
costume.md5 = `${costume.assetId}.${costume.dataFormat}`;
|
||||||
this.emitTargetsUpdate();
|
this.emitTargetsUpdate();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue